その後、次のような PHP コードでメールの送信テスト。
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?PHP $sender = '{sender email adress}'; $recipient = '{recipient email address }'; $subject = "php mail test"; $message = "php test message"; $headers = 'From:' . $sender; if (mail($recipient, $subject, $message, $headers)) { echo "Message Sent"; } else { echo "Error"; } |
参考: https://www.arclab.com/en/kb/php/how-to-test-and-fix-php-mail-function.html