Skip to main content

Posts

Showing posts with the label sending Emails from asp.net application

Send Templated Emails Using MailDefinition Object in asp.net

Sending Email using Templates Asp.net: Previous post explained about the Sending Email from Asp.net With Dynamic Content  Recently I Was found a better way to format my email messages in ASP.NET using the MailDefinition object. It lets you to use an email template and define tokens which you want to replace in it. This helps keep the presentation and business layers clean & separate and lets the designers go in and edit the email templates without having to navigate the StringBuilder. This article explains how to send email using ASP.NET. Yes, there are many other articles that cover sending email via .NET, I found that many articles suggest you create your HTML email using a string with the HTML markup in it. In this article we will look at a more detailed solution. One in which we use a regular HTML file as our template for the email. The template file will be a standard HTML file with the exception of some placeholders that we will use to populate our cont...

How Generate HTML e-mail body in C# using templates

I think that any modern piece of software today, needs to send e-mail. Whether it being password recovery e-mails, rich reports, newsletters or anything else – being able to easily see and customize the look and feel of your e-mails is vital. So, the worst way I could think of is having your HTML hidden away in some StringBuilder.Append() hell. The best solution (in my opinion) would be, if you could have plain old HTML files with parameters like <#FirstName#> so you could dynamically replace those at run time. The MailDefinition class Using the  MailDefinition  class is pretty straight forward. You use the  MailDefinition  class to create an instance of  MailMessage , which you can send straightaway More About Refer : http://martinnormark.com/generate-html-e-mail-body-in-c-using-templates/ http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.maildefinition.aspx http://stackoverflow.com/questions/886728/generating-html-e...

Sending Emails from asp.net application

Sending Emails from asp.net application using c#.net Check this post also for sending mails with dynamic content Send Templated Emails Using MailDefinition Object in asp.net using System ; using System . Collections . Generic ; using System . Linq ; using System . Web ; using System . Web . UI ; using System . Web . UI . WebControls ; using System . Collections ; using System . Data . OleDb ; using System . Web . Security ; using System . Data ; using System . Configuration ; using System . Net . Mail ; public partial class Default5 : System . Web . UI . Page { protected void btEnvoyer_Click ( object sender , EventArgs e ) { MailMessage message = new MailMessage (); SmtpClient smtpClient = new SmtpClient (); // try // { MailAddress fromAddress = new MailAddress ( tbDestinataire . Text ); message . From = fromAddress ; ...