用Jmail发信怎么收到的内容老是空或者是乱码啊
jmail.Message Jmail = new jmail.Message();
DateTime t = DateTime.Now;
String Subject = "你好啊23123123123!!! ";
String body = "16546546132131311 ";
String FromEmail = "admin@xxxx.com ";
String ToEmail = "xxxx@xxx.com ";
//Silent属性:如果设置为true,JMail不会抛出例外错误. JMail. Send( () 会根据操作结果返回true或false
Jmail.Silent = true;
//Jmail创建的日志,前提loging属性设置为true
Jmail.Logging = true;
//字符集,缺省为 "US-ASCII "
Jmail.Charset = "GB2312 ";
//信件的contentype. 缺省是 "text/plain ") : 字符串如果你以HTML格式发送邮件, 改为 "text/html "即可。
Jmail.ContentType = "text/html ";
//添加收件人
Jmail.AddRecipient(ToEmail, null, null);
Jmail.From = FromEmail;
//发件人邮件用户名
Jmail.MailServerUserName = "admin@xxxx.com ";
//发件人邮件密码
Jmail.MailServerPassWord = "xxxx ";
//设置邮件标题
Jmail.Subject = Subject;
//邮件添加附件,(多附件的话,可以再加一条Jmail.AddAttachment( "c:\\test.jpg ",true,null);)就可以搞定了。[注]:加了附件,讲把上面的Jmail.ContentType= "text/html ";删掉。否则会在邮件里出现乱码。
//Jmail.AddAttachment( "c:\\test.jpg ", true, null);
//邮件内容
Jmail.Body = "123123123123 ";
//Jmail发送的方法
Jmail.Send( "oa.yy960.com ", false);
Jmail.Close();
用Jmail发信怎么收到的内容老是空或者是乱码啊
错误如下:
有时收到是空
有时是
This is a multipart message in MIME format. ----NEXT_BM_304F011929314E10B57504223FE6CEF8 Content-Type: text/plain; charset= "GB2312 " Conte