Skip to content

Instantly share code, notes, and snippets.

@macariojames
Created August 10, 2018 19:07
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 macariojames/9c067fc4e62629e707f6d1d8cb02274c to your computer and use it in GitHub Desktop.
Save macariojames/9c067fc4e62629e707f6d1d8cb02274c to your computer and use it in GitHub Desktop.
Testing php sendmail is working correctly
<?php
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = "emailtest@currentdomain.com";
$to = "myemail@currentdomain.com";
$subject = "PHP Mail Test script via currentdomain";
$message = "This is a test to check the PHP sendmail functionality.";
$headers = "From:" . $from;
if(mail($to,$subject,$message, $headers))
echo "Test email sent from currentdomain.";
else
echo "Error: Message not sent :-(";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment