Send email with PHP script

So you want to send an email through a PHP script. Well that is dead simple (provided you have your smtp server setup correctly). See the code fragment below:

$to = "";
$subject = "Your subject";
$message = "Your message";
$headers = "From:" . "\r\n" .
   "Reply-to:" . "\r\n" .
   "X-Mailer: PHP/" . phpversion();
mail($to, $subject, $message, $headers);



Leave a Reply

Your email address will not be published. Required fields are marked *