Reputation: 350
How can I add an attachment to the mailto function in C#?
This is what I have so far:
VWGClientContext.Current.Invoke("(function() {window.location.href='mailto:" + "[email protected]" + "?Subject=" + "SubjectText" + "&body=" + "BodyText" + "'; })();");
Is it something like this "&Attachment=" ....?
The file that needs to be added is stored on a server not a local pc.
Upvotes: 0
Views: 186
Reputation: 1472
Use:
&attach=C:\Documents%20and%20Settings\username\Desktop\foldername\NameOfFile.txt
Upvotes: -1
Reputation: 82474
Don't use the mailto:
link.
Instead, send the email from the server using the classes provided in the System.Net.Mail
namespace. This way you can add the file that's on your server as an attachment, using the Attachment
class. (there is a code example in the MSDN page I've linked to)
If you need to, you can have the user fill out a form with the message body and subject and send the mail using the user input.
Upvotes: 2
Reputation: 3726
you might be interested in this:
https://msdn.microsoft.com/en-us/library/system.net.mail.attachment%28v=vs.110%29.aspx
Upvotes: 1