Created
October 10, 2020 15:53
-
-
Save kiichi/946f6a3f3346c1d9717804a268d8ec64 to your computer and use it in GitHub Desktop.
PHP Email Test Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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