I add an attachment like this:
System.Net.Mail.Attachment attachment = new System.Net.Mail.Attachment(AttachmentPath); msg.Attachments.Add(attachment);
How about:
System.Net.Mail.Attachment attachment = new System.Net.Mail.Attachment(attachmentPath); attachment.Name = "file.txt"; // set name here msg.Attachments.Add(attachment);