views:

716

answers:

2

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.

A: 

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.

Shoban
Is it possible that this does not work with all Email client,like different version of Mcrosoft Outlook?
David Brunelle
+1  A: 

From what I saw on the web (and by trying it to), it is not always possible to do so. Some email client, and by some I mean lots of them, will not let you do this because it is considered a security hole. However, when it is accepted, the syntax provided by Shodan looks good.

David Brunelle