Try
{
CDO. messageclass omsg = new CDO. messageclass ();
Omsg. From = "xxx@163.com"; // your email
Omsg. To = "xxx@163.com"; // receive email
Omsg. Subject = "mail test .";
Omsg. htmlbody = "<HTML> <body> mail test. </body> CDO. iconfiguration iconfig = omsg. configuration;
ADODB. Fields ofields = iconfig. fields;
Ofields ["http://schemas.microsoft.com/cdo/configuration/sendusing"]. value = 2;
Ofields ["http://schemas.microsoft.com/cdo/configuration/sendemailaddress"]. value = "xxx@163.com ";
Ofields ["http://schemas.microsoft.com/cdo/configuration/smtpaccountname"]. value = "zhgroup.ltd@163.com"; ["http://schemas.microsoft.com/cdo/configuration/sendusername"]. value = "zhgroup. Ltd ";
Ofields ["http://schemas.microsoft.com/cdo/configuration/sendpassword"]. value = "XXX"; // verify the account name
Ofields ["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"]. value = 1; // verification level, 2
Ofields ["http://schemas.microsoft.com/cdo/configuration/languagecode"]. value = 0x0804;
Ofields ["http://schemas.microsoft.com/cdo/configuration/smtpserver"]. value = "smtp.163.com"; // SMTP Server
Ofields. Update ();
Omsg. bodypart. charset = "gb2312 ";
Omsg. htmlbodypart. charset = "gb2312 ";
Omsg. Send ();
Omsg = NULL;
}
Catch (exception ER)
{
...
}