Skip to content

Instantly share code, notes, and snippets.

@johannez
Created January 14, 2014 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johannez/8411226 to your computer and use it in GitHub Desktop.
Save johannez/8411226 to your computer and use it in GitHub Desktop.
<?php
$to = "recipient@example.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$headers = "From: sender@example.com\r\n" .
"X-Mailer: php";
if (mail($to, $subject, $body, $headers)) {
echo("<p>Message sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment