I am using the SmtpClient
class to send mail and also attach files. Everything seems to work fine, except that the filename in the email attachment says filestest.docx
instead of test.docx
. It is by default appending the folder name the file is located under. I would like to see only the actual file name.
msg.Attachments.Add(new Attachment("I:/files/test.docx"));
Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…