c# - How to set a nice name for an e-mail (System.Net.Mail.SmtpClient) attachment -
I am sending the attachment using the System.Net.Mail.SmtpClient in C #.
The attachment name is the same as the name of the file I enter the attachment constructor
myMail.Attachments.Add (new attachment (attachmentFileName));
How do I go about setting up a "good" name for the attachment? The names I currently have are basically numerical IDs which indicate which incident of the report has been attached. My users are looking for some more friendly things like "results.xls".
see:
MIME content in the content type related to this attachment Set or set type name value
You can like the property to name . In the example inside the last link, you may have:
// Create file attachments for this email message. Attachment Data = New Attachment (File, MediaTipName. Application.Octate); Data Name = "very name. // (not in the original example) ... message. Attachments.Add (data);
Comments
Post a Comment