Open email client with attachment file

Asked

Viewed 297 times

2

I am trying to open my email client (for example Outlook) with the following:

<a href="mailto:[email protected]?subject=Assundo email&body=Corpo de email">
Send mail</a>

Now I’d like to send an attachment through mailto. I’ve seen that it’s not possible with the function mailto, but there is another way to open my email client with an attached file?

1 answer

0

The "mailto" protocol does not offer this feature, mainly because it is local and may vary from device to device. The "Javascript" level is also not possible because of security issues and inability to communicate with the operating system to obtain files. An alternative would be to call the protocol "mailto", you make available on the page the upload of the file and after the completion of sending call the function that triggers the email, in case if it is PHP, the function "mail".

  • Yes, but the goal is the attachment to pass to the email client. Thank you

  • That’s right @pc_oc, you asked another way and quoted in the answer. The way I know today would be you do it on the server side. Via Javascript there is no way to attach a direct file called the protocol "mailto".

  • See if this topic can help you: https://stackoverflow.com/questions/1195111/c-sharp-mailto-with-attachment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.