Home | Articles|Namespace|Interview Questions|Tools|Jobs|Projects|Community
Asp.net Tutorials

»Dotnet Ads
»Message Boards
Message Boards
Dotnet Books

»Member Details
Register
Login
LogOut
Submit Code
Submit Jobs
Submit Projects

»Competition
Community
Winners
Prizes
Write For Us
Members

»Other Resources
Links
Dotnet Resources


Forums»C# .NET »



Creating Emails Dynamically

using System.Web.Mail

string to = jdoe@abc.com;
string from = support@abc.com;
string subject = "This is the Subject of your email";
string msg = "Text of your email";
Declare a new mailmessage object
System.Web.Mail.MailMessage mail = new System.Web.Mail.MailMessage();
mail.To = to;
mail.From = from;
mail.Subject = subject;
mail.BodyFormat = MailFormat.Html;
mail.Body = msg;
SmtpMail.Send(mail);
mail = null;

If you need any additional information check out System.Web.Mail in the MSDN.
posted by:Nathan  on 5/3/2007 12:00:00 AM
© 2008 dotnetwatch.com -- Privacy policy

Website Design & Internet Marketing by Shivam