I want to send Email with predefined template which is freely availabel on google. I want to send those template in email body How can i send mail with some predefined template rather than plain text. And the second related question is that how can I create
my own template for Email body.
Any link giving these details and more will be of great help. Actually I am trying to build a mass mailing project.
you can use postal: https://github.com/andrewdavey/postal .It is available also as a Nuget package. It uses the Mvc View engine to create Html based emails.
Unable to compile this project after downloading : The Errors are missing file "postal.dll" and couldnot find this file anywhere in solution to add its reference.
Error 1 Assembly 'Postal, Version=0.7.1.0, Culture=neutral, PublicKeyToken=45719375b8b4d528' uses 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc,
Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' d:\Extra\No Webiste or Prooject\Email\Vikram-Shah-postal-6c02cc0\src\Postal\bin\Debug\Postal.dll Postal.Tests
Your problem is Postal uses MVC4 and you have reference to MVC3 DLLs, you can either download and install MVC4 and complile again. Or try downloading the source code from github and then compile using MVC3, I am not sure if they have specific class reference
which exist only in MVC4, in that case it is better to use with MVC4.
I have MVC4 alredy installed and this is what I was doing,, I was clicking on the solution icon, in the porject after downloading the project from github , all the files automatically get into project but I am unble to compile the project as i get the missing
portal.dll eror.
I am still unable to compile the project. Tried various option like right clicking the solution of MVC4 and add->existing project etc
vikram shah
Member
88 Points
261 Posts
Sending Template in Email
Aug 18, 2012 11:32 AM|LINK
How can is send a readymade template in Email.
Thanks.
Mahesh Darku...
Participant
896 Points
238 Posts
Re: Sending Template in Email
Aug 18, 2012 11:38 AM|LINK
Please expalin in brief..
vikram shah
Member
88 Points
261 Posts
Re: Sending Template in Email
Aug 18, 2012 12:00 PM|LINK
I want to send Email with predefined template which is freely availabel on google. I want to send those template in email body How can i send mail with some predefined template rather than plain text. And the second related question is that how can I create my own template for Email body.
Any link giving these details and more will be of great help. Actually I am trying to build a mass mailing project.
Thanks.
francesco ab...
All-Star
20912 Points
3279 Posts
Re: Sending Template in Email
Aug 18, 2012 12:07 PM|LINK
you can use postal: https://github.com/andrewdavey/postal .It is available also as a Nuget package. It uses the Mvc View engine to create Html based emails.
Mvc Controls Toolkit | Data Moving Plug-in Videos
vikram shah
Member
88 Points
261 Posts
Re: Sending Template in Email
Aug 18, 2012 12:26 PM|LINK
Unable to compile this project after downloading : The Errors are missing file "postal.dll" and couldnot find this file anywhere in solution to add its reference.
Error 1 Assembly 'Postal, Version=0.7.1.0, Culture=neutral, PublicKeyToken=45719375b8b4d528' uses 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' d:\Extra\No Webiste or Prooject\Email\Vikram-Shah-postal-6c02cc0\src\Postal\bin\Debug\Postal.dll Postal.Tests
Pls suggest..
CPrakash82
All-Star
18284 Points
2841 Posts
Re: Sending Template in Email
Aug 18, 2012 01:33 PM|LINK
Your problem is Postal uses MVC4 and you have reference to MVC3 DLLs, you can either download and install MVC4 and complile again. Or try downloading the source code from github and then compile using MVC3, I am not sure if they have specific class reference which exist only in MVC4, in that case it is better to use with MVC4.
francesco ab...
All-Star
20912 Points
3279 Posts
Re: Sending Template in Email
Aug 18, 2012 02:06 PM|LINK
Wirth Mvc 3 you can use MvcMailer (it is on nuget): https://github.com/smsohan/MvcMailer
Mvc Controls Toolkit | Data Moving Plug-in Videos
QuantumInfor...
Member
199 Points
228 Posts
Re: Sending Template in Email
Aug 18, 2012 10:36 PM|LINK
like so:)
using ( StreamReader reader = File.OpenText(HttpContext.Current.Server.MapPath("~/content/mail/welcome.html"))) // Path to your { var email = new MailMessage( ReplyTo, model.Email ) ; email.Subject = String.Format("Welcome to {0}", ConfigurationManager.AppSettings["ApplicationName"]); email.IsBodyHtml = true; email.Body = reader.ReadToEnd(); return email; }DhavalShah89
Member
112 Points
78 Posts
Re: Sending Template in Email
Aug 19, 2012 01:40 AM|LINK
You will need to create html file.
<html>
<body>
Dear [Name], ...
</body>
</html>
you will read the file, replace [name] in action with your data and then send mail.
vikram shah
Member
88 Points
261 Posts
Re: Sending Template in Email
Aug 20, 2012 08:28 AM|LINK
I have MVC4 alredy installed and this is what I was doing,, I was clicking on the solution icon, in the porject after downloading the project from github , all the files automatically get into project but I am unble to compile the project as i get the missing portal.dll eror.
I am still unable to compile the project. Tried various option like right clicking the solution of MVC4 and add->existing project etc
Is there any other way..