作者magic704226 (洨鲁)
看板C_Sharp
标题[问题] SmtpClient寄信,档名想设定成中文
时间Tue Feb 10 17:38:59 2015
MailMessage myMail = new MailMessage();
SmtpClient mySmtpServer = new SmtpClient("smtp.gmail.com");
myMail.From = new MailAddress("
[email protected]", "Test Group");
myMail.To.Add("
[email protected]");
myMail.Bcc.Add("
[email protected]");
myMail.Subject = "Test";
string myFile3 = pdfPath;
Attachment myAttach3 = new Attachment(myFile3, MediaTypeNames.Application.Octet);
ContentDisposition disposition3 = myAttach3.ContentDisposition;
disposition3.FileName = "ticket.pdf"; <---------------- 想设定成中文
disposition3.CreationDate = System.IO.File.GetCreationTime(pdfPath);
disposition3.ModificationDate = System.IO.File.GetLastWriteTime(pdfPath);
disposition3.ReadDate = System.IO.File.GetLastAccessTime(pdfPath);
myMail.Attachments.Add(myAttach3);
这有没有解啊?
我网路找很久都没找到
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 110.26.187.95
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/C_Sharp/M.1423561141.A.A48.html
1F:→ konkonchou: 4.5 以上, 4.0以下太长常会出问题 02/10 20:03