Skip to content

Instantly share code, notes, and snippets.

@robwent
Created May 18, 2018 23:26
Show Gist options
  • Select an option

  • Save robwent/75dde25474e7313f79d3357aebfdb2d8 to your computer and use it in GitHub Desktop.

Select an option

Save robwent/75dde25474e7313f79d3357aebfdb2d8 to your computer and use it in GitHub Desktop.
Drop in a folder and browse to it to check php mail is working.
<?php
$to = "me@mydomain.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Email successfully sent!</p>");
} else {
echo("<p>Email delivery failed!</p>");
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment