Software consultant, Developer, Codder : SharePoint, Office 365, ASP.NET, MVC, SharePoint, Javascript, JQuery, Ember JS, Angular JS, Entity Framework, Linq, HTML5, DotnetNuke, codding philosophy, blogger 7+ experience in codding and developing web applications, Code 4 Help..
public class EamilInfo { public string Subject { get; set; } public string Body { get; set; } public string FromEamil { get; set; } public string ToEamil { get; set; } }
public class MailController : MailerBase { public EmailResult SampleEamil(EamilInfo model) { To.Add(model.ToEamil); From = model.FromEamil; Subject = model.Subject; //CC.Add(); //BCC.Add(); //Attachments.Add(); return Email("EmailTemplate",model); } public EmailResult SampleEamil1() { To.Add("testmail1@gmail.com"); From = "testmail2@gmail.com"; Subject = "Test"; //CC.Add(); //BCC.Add(); //Attachments.Add(); return Email("EmailTemplate1"); } }
using ActionMailer.Net @model EmailController.Models.EamilInfo @{ Layout = null; } EmailTemplate.html Hi @Model.ToEamil, This is test email @Model.Body Thnaks & Regards, @Model.FromEamil
new MailController().SampleEamil(new EamilInfo { Body = "ActionMailer is awesome!", FromEamil = "ranmal.ratiya@gmail.com", ToEamil = "ranmal007@gmail.com", Subject = "Actionmailer Demo" }).Deliver(); new MailController().SampleEamil(new EamilInfo { Body = "ActionMailer is awesome!", FromEamil = "ranmal.ratiya@gmail.com", ToEamil = "ranmal007@gmail.com", Subject = "Actionmailer Demo" }).DeliverAsync();
Where I have to place the code which is present in step5? I have tried in Controller. But it's showing error. Please help me out.
Where I have to place the code which is present in step5? I have tried in Controller. But it's showing error. Please help me out.
ReplyDelete