Skip to content

Instantly share code, notes, and snippets.

@pierrehenri220
Created November 19, 2017 06:47
Show Gist options
  • Save pierrehenri220/55b22a359c8b5b4acac6361d405ab92c to your computer and use it in GitHub Desktop.
Save pierrehenri220/55b22a359c8b5b4acac6361d405ab92c to your computer and use it in GitHub Desktop.
Simple PHP Mail test
<?php
# Source: https://www.conetix.com.au/support/article/simple-php-mail-test
# Howto: ssh login, then php test-email.php
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = "emailtest@YOURDOMAIN";
$to = "YOUREMAILADDRESS";
$subject = "PHP Mail Test script";
$message = "This is a test to check the PHP Mail functionality";
$headers = "From:" . $from;
mail($to,$subject,$message, $headers);
echo "Test email sent";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment