Post: [PHP] Making a simple mailer
11-20-2013, 04:16 AM #1
Dan
I'm a god.
(adsbygoogle = window.adsbygoogle || []).push({}); This is just a short a sweet tutorial on making a PHP mailer.

    
<?php

if(isset($_POST['send_mail'])) {
$to = $_POST['to'];
$headers = 'From: '.$_POST['from']. "
" .
'Reply-To: ' . $_POST['from'] . "
" .
'X-Mailer: PHP/' . phpversion();
$message = $_POST['message'];

mail($to, $message, $headers);
}
?>

<form method="POST">
From:<br>
<input type="text" name="from" placeholder="Your Email"><br><br>
To:<br>
<input type="text" name="to" placeholder="Recipient's Email"><br><br>
Your Message:<br>
<textarea name="message" placeholder="Your Message" rows="100" cols="100"></textarea><br><br>
<input type="submit" name="send_mail" value="Send Mail">
</form>

The following 2 users say thank you to Dan for this useful post:

Kieron, TheUnexpected

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo