0

I want to send an email after submitting a html form without using a server , is this possible?

i tried a javascript solution

function sendMail() {
    var link = "mailto:myemail@mail.com"
             + "?cc=myCCaddress@example.com"
             + "&subject=" + escape("This is my subject")
             + "&body=" + escape(document.getElementById('name').value)
    ;

    window.location.href = link;

}

But it did not work , is there a solution please?

  • No, it's not possible, a `mailto` link won't really send anything, best case it only opens the users email program. If you want to actually send something, you have to do it on the serverside – adeneo Aug 08 '17 at 08:46
  • Duplicated [https://stackoverflow.com/questions/7381150](https://stackoverflow.com/questions/7381150/how-to-send-an-email-from-javascript) – marcramser Aug 08 '17 at 08:47
  • It is only possible to open up your default mail app – lumio Aug 08 '17 at 08:48

0 Answers0