Open email client with php attachment file

2

I'm 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 wanted to send an attachment by mailto . I have seen that it is not possible with the mailto function, but is there another way to open my email client with an attached file?

    
asked by anonymous 12.07.2017 / 13:08

1 answer

0

The mailto protocol does not offer this feature, mainly because it is local and can 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 instead of calling the "mailto" protocol, you make available on the page the file upload and after the completion of the send call the function that triggers the email, in the case of PHP, the "mail" function.

    
12.07.2017 / 14:10