There are required demos for send a email with C sharp language. However, you will find that most of them will be failed because of smtpserver. Especially, authorization is required.
Public void sendemail ()
...{
Mailmessage mail = new mailmessage ();
Mail. Priority = mailpriority. High;
Mail. From = "cccc@gmail.com ";
Mail. To = "cccc@163.com ";
Mail. Subject = "Send email system Demo ";
Mail. Body = "just for test .";
Mail. bodyencoding = encoding. utf8;
// Authorization
Mail. Fields. Add ("http://schemas.microsoft.com/cdo/configuration/sendusing", 1 );
Mail. Fields. Add ("http://schemas.microsoft.com/cdo/configuration/sendemailaddress", mail. From );
Mail. Fields. Add ("http://schemas.microsoft.com/cdo/configuration/smtpuserreplyemailaddress", mail. From );
Mail. Fields. Add ("http://schemas.microsoft.com/cdo/configuration/smtpaccountname", "cccc@163.com ");
Mail. Fields. Add ("http://schemas.microsoft.com/cdo/configuration/sendpassword", "CCCC ");
Mail. Fields. Add ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1 );
Mail. Fields. Add ("http://schemas.microsoft.com/cdo/configuration/smtpserver", "smtp.163.com ");
Smtpmail. smtpserver = "smtp.163.com ";
Smtpmail. Send (Mail );
}
# Endregion