System.Web.Mail.MailMessage message=new System.Web.Mail.MailMessage(); message.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",1 ); message.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendusername","SmtpHostUserName" ); message.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendpassword","SmtpHostPassword" ); message.From="from e-mail"; message.To="to e-mail"; message.Subject="Message Subject"; message.Body="Message Body"; System.Web.Mail.SmtpMail.SmtpServer="SMTP Server Address"; System.Web.Mail.SmtpMail.Send(message);
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Authenticated SMTP in C# (See related posts)
You need to create an account or log in to post comments to this site.
Related Posts
» Quick Mail class in mail smtp csharp
» Changing your hostname which... in exim mail smtp
» Populating a Winforms ComboB... in .net csharp
» exim router for relaying via... in sysadmin freebsd exim mail smarthost
» Borked LoadImageFromURL Meth... in windows .net pocketpc mobile windowsmobile
» csharp app.path in csharp
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails