Send Email with C # [Reference Microsoft Chinese Community]

xiaoxiao2021-03-06  103

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 = " mail test. "; 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/cdpo/configuration/smtpaccountname "] .value =" zhgroup.Ltd@163.com "; [" http://schemas.microsoft.com/ CDO / Configuration / SenduserName "]]. Value =" hp); Ofields ["http://schemas.microsoft.com/cdo/configuration/sendpassword"] .value = "xxx"; // Verify account name Ofields [ "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"].value = 1; // Verification level 0,1,2 ofields [" http://schemas.microsoft.com/cdo/configuration/languagecode "] .Value = 0x0804; ouerds [ "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) {

...

}

转载请注明原文地址:https://www.9cbs.com/read-125029.html

New Post(0)