|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionWhen you send e-mail using The CodeYou can easily update your existing code. For example take this: eMail = new MailMessage();
eMail.BodyFormat = MailFormat.Text;
eMail.To = "recipients@codeproject.com";
eMail.Body = _Body;
eMail.From = _SendFrom;
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(eMail);
Just add two lines of code and you are done: eMail = new MailMessage();
eMail.BodyFormat = MailFormat.Text;
eMail.To = "recipients@codeproject.com";
eMail.From = _SendFrom;
eMail.Body = _Body;
SmtpMail.SmtpServer = "localhost";
eMail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"] = 1;
eMail.Fields[
"http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"] =
"C:\\Inetpub\\mailroot\\Pickup";
SmtpMail.Send(eMail);
ConclusionEspecially if you want to send loads of e-mails, like in a newsletter application, you should keep this in mind.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||