Skip to content

Instantly share code, notes, and snippets.

@kiichi
Created October 10, 2020 15:53
Show Gist options
  • Save kiichi/946f6a3f3346c1d9717804a268d8ec64 to your computer and use it in GitHub Desktop.
Save kiichi/946f6a3f3346c1d9717804a268d8ec64 to your computer and use it in GitHub Desktop.
PHP Email Test Script
<?php
$subject = 'hello world';
$mailto = '(my email)';
$mailfrom = 'do_not_reply@(email)';
$content = 'Test email !';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From:".$mailfrom;
//$success = mail($mailto,$subject,$content,$headers);
$success = mail($mailto,$subject,$content);
if (!$success) {
$errorMessage = error_get_last()['message'];
echo $errorMessage;
}
else {
echo 'success!';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment