0

I want the user to input the message they want to send in a form, but after they click send, it brings up their email for them to send.

The only reason for this is because I don't have a server.

Is this possible?

Thanks

Jake Xia
  • 81
  • 9

3 Answers3

1

According to this question, you can do it with Javascript:

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

    window.location.href = link;
}
<textarea id="myText">Lorem ipsum...</textarea>
<button onclick="sendMail(); return false">Send</button>
Community
  • 1
  • 1
andreas
  • 16,357
  • 12
  • 72
  • 76
1
using this function for sending email without server you can send mail using you mail id too

<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?> 
ashok
  • 69
  • 5
0

If you want to send emails, a good approach (there are multiples) is to use php to send your email.

You will have an html like this for example:

<form action="action_page.php">
Email:<br>
<input type="text" name="email">
<br>
Text:<br>
<input type="text" name="Text">
<br><br>
<input type="submit" value="Submit">
</form>

<p>If you click "Submit", the form-data will be sent to a page called "action_page.php".</p>

Then in php:

<?php
$receiver = "empf@domain.de";
$subject = "Die Mail-Funktion";
$from = "From: Nils Reimers <absender@domain.de>";
$text = "Hier lernt Ihr, wie man mit PHP Mails verschickt";

mail($receiver, $subject, $text, $from);
?>

You should look up on how to get your input data from your form to php...

Tom el Safadi
  • 6,164
  • 5
  • 49
  • 102