Search code examples
c#attachmentmailto

Mailto C# attachment syntax


How can I attach a file to this mailto string?

string mailto = "mailto:" + to + "&SUBJECT=" + subject + "?BODY=" + body + 
    "&Attachment=" + attachment;

This doesn't work; the file isn't attached.


Solution

  • Remove the quotes at the end of "attachment".

    "mailto:" + to + "&SUBJECT=" + subject + "?BODY=" + body + "&Attachment=" + attachment
    

    Where attachment has the attachment link.

    Note: This will not work if the users dont have access to the attachment so you can try attaching and sending it through a c# code.