Adding an attachment to a .NET Email

Posted by Velika on Stack Overflow See other posts from Stack Overflow or by Velika
Published on 2010-04-03T03:21:00Z Indexed on 2010/04/03 3:23 UTC
Read the original article Hit count: 380

Filed under:
|
|

How do I attach a file with a very unfriendly name (like a file with a session Id number in it) but have it attached as another name?The file has the session ID in it to avoid clashes name on the web server nut when I attach it to the file, a friendlier name is preferable.

Is there a way to attach the file with teh unfriendly name as anotehr name so that when the user gets the email he can tell from the name what the content of the file is? I'd hate to have to create a unique folder just to put a common file name in it for the purpose of simply attaching it to an email.

Dim mailMessage As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage() mailMessage.Attachments.Add("unfriendlyname.txt", ????)

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about mail