myMail.AddRecipient("[email protected]","testzhang",""); myMail.Subject="this is a test"; myMail.Body="this is a test ,author is zhangzhenliang";
myMail.Send("smtp.126.com",false);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "username"); //set your username here mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password"); //set your password here 只支持v1.1及以上的版本
我的问题可能是虽然装了1.1但是Visual Studio的调试环境还是原来的环境,所以不能运行。
代码如下:
jmail.MessageClass myMail=new jmail.MessageClass();
myMail.Charset="GB2312";
myMail.Silent=true;
myMail.Priority=3;
myMail.MailServerUserName="[email protected]";
myMail.MailServerPassWord="*****";
myMail.From="[email protected]";
myMail.AddRecipient("[email protected]","testzhang","");
myMail.Subject="this is a test";
myMail.Body="this is a test ,author is zhangzhenliang";
myMail.Send("smtp.126.com",false);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "username"); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password"); //set your password here
只支持v1.1及以上的版本