+ 3
Is there a way to send an email in js without opening the mail app?
I've seen other email codes and they all open the email app, is there a way to send without the app?
3 Answers
+ 8
You can't send an email directly with javascript.
You can, however, open the user's mail client:
window.open('mailto:test@example.com');
There are also some parameters to pre-fill the subject and the body:
window.open('mailto:test@example.com?subject=subject&body=body');
Another solution would be to do an ajax call to your server, so that the server sends the email. Be careful not to allow anyone to send any email through your server.
+ 1
can you change the to and from
+ 1
that opens the app