Skip to content

Instantly share code, notes, and snippets.

@wykydtronik
Created April 15, 2017 05:05
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 wykydtronik/dd63a34c7b05229ca01ec464b669814e to your computer and use it in GitHub Desktop.
Save wykydtronik/dd63a34c7b05229ca01ec464b669814e to your computer and use it in GitHub Desktop.
testing mail() on apache
<?php
$to = "test@email.com";
$header = "From: {$to}";
$subject = "Test Subject Here";
$body = "Hi this is a test email to see if the mail() function is working properly on your site.";
if (mail($to, $subject, $body, $header)) {
echo ("<p>Message successfully 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