MailMessage mail
=
new
MailMessage();
mail.To = " me@163.com " ;
mail.From = " you@163.com " ;
mail.Subject = " this is a test email. " ;
mail.Body = " Some text goes here " ;
mail.Fields.Add( " http://schemas.microsoft.com/cdo/configuration/smtpauthenticate " , " 1 " ); // basic authentication
mail.Fields.Add( " http://schemas.microsoft.com/cdo/configuration/sendusername " , " AlleNny " ); // set your username here
mail.Fields.Add( " http://schemas.microsoft.com/cdo/configuration/sendpassword " , " Password " ); // set your password here
SmtpMail.SmtpServer = " smtp.163.com " ; // your real server goes here
SmtpMail.Send( mail );
mail.To = " me@163.com " ;
mail.From = " you@163.com " ;
mail.Subject = " this is a test email. " ;
mail.Body = " Some text goes here " ;
mail.Fields.Add( " http://schemas.microsoft.com/cdo/configuration/smtpauthenticate " , " 1 " ); // basic authentication
mail.Fields.Add( " http://schemas.microsoft.com/cdo/configuration/sendusername " , " AlleNny " ); // set your username here
mail.Fields.Add( " http://schemas.microsoft.com/cdo/configuration/sendpassword " , " Password " ); // set your password here
SmtpMail.SmtpServer = " smtp.163.com " ; // your real server goes here
SmtpMail.Send( mail );