Welcome to Comunidade Bloggers |create|it| Sign in | Join | Help

Raúl Ribeiro

Windows SharePoint Services 3.0 , .net, Microsoft Office SharePoint 2007, Office 2007 and 2010

News

using System.Web.Mail with authentication

MailMessage msg = new MailMessage();

msg.From = ConfigurationSettings.AppSettings["From"].ToString();
msg.Subject = subject;
msg.To = messageTo;

msg.Fields["
http://schemas.microsoft.com/cdo/configuration/smtpserver"] = Settings.SmtpServer;
msg.Fields["
http://schemas.microsoft.com/cdo/configuration/smtpserverport"] = Settings.SmtpServerPort.ToString(CultureInfo.InvariantCulture);
msg.Fields["
http://schemas.microsoft.com/cdo/configuration/sendusing"] = 2;
msg.Fields["
http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;
msg.Fields["
http://schemas.microsoft.com/cdo/configuration/sendusername"] = Settings.SmtpSendUserName;
msg.Fields["
http://schemas.microsoft.com/cdo/configuration/sendpassword"] = Settings.SmtpSendPassword;

SmtpMail.Send( msg );

Posted: Thursday, June 30, 2005 6:24 PM by rrr
Filed under:

Comments

No Comments

Anonymous comments are disabled