sendmail の設定。"C:\xampp\sendmail\sendmail.ini"
を編集。
以下は相応のものに書き換え。
– {my email address}
– {account name given by sakura internet}
– {my email account password}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
[sendmail] smtp_server={account name given by sakura internet}.sakura.ne.jp smtp_port=587 smtp_ssl=tsl error_logfile=error.log auth_username={my email address} auth_password={my email account password} pop3_server= pop3_username= pop3_password= force_sender={my email address} force_recipient= hostname= |
Postscripts
その後、次のような PHP コードでメールの送信テスト。
12345678910111213<?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