Skip to content Skip to sidebar Skip to footer

Javascript - Mail

I want to send an email in a text-area to many other users. In the text-area, named content, if I typed 'user' surrounded by stars, I want to have them filled in with each email's

Solution 1:

Unfortunately it's not possible to send an email using JavaScript, but you can do it with PHP. Here, the variable options you have above has been placed in a form and sent to the PHP page via POST, with the name="options" in the input attribute:

<?php$options = $_POST['options'];
    $to = "person@example.com";
    $subject = "Random Life";
    $body = "Lorem ipsum dolor. $options";

    mail ($to,$subject,$body);

 ?>

This will send an email to person@example.com, with the subject Random Life, and the content Lorem ipsum dolor [options], where options is the value passed by the form.

But in finality, no, it is not possible to send an email using JavaScript currently. It may be possible in future years, but currently not available.

Post a Comment for "Javascript - Mail"