ho aggiungere un allegato in questo modo:Set nome email Allegato in C#
System.Net.Mail.Attachment attachment = new System.Net.Mail.Attachment(AttachmentPath);
msg.Attachments.Add(attachment);
Ma io voglio farlo attaccare con un nome diverso, il nome del file reale è molto lunga e confusa mi piacerebbe allegare come "file.txt", c'è un modo semplice per farlo senza dover fare una copia del file?
Questo è ciò che ha funzionato per me: attachment.ContentDisposition.FileName = "file.txt"; – MarkHoward02