if(附件绝对路径!="")//添加附件 { System.Net.Mime.ContentType type = new System.Net.Mime.ContentType("application/vnd.openxmlformats-officedocument.wordprocessingml.document"); System.Net.Mail.Attachment objAtt = new System.Net.Mail.Attachment(附件绝对路径, type);
ObjMail.Attachments.Add(objAtt);
ContentDisposition disposition = objAtt.ContentDisposition; disposition.DispositionType = "attachment; filename=" + Path.GetFileName(附件绝对路径);
}
邮件原文格式
-----------=_VxiQcghCADTbNqgPmLRpqAGvcowuwOnorRmShm
Content-Type: application/octet-stream; 内容是应用,即附件
name="aa.doc" 附件应用名
Content-Transfer-Encoding: base64 编码格式
Content-Disposition: attachment; 内容描述:附件
filename="aa.doc"