Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.