WindowsでxamppにSMTP mailサービスを設定する

設定方法

1.xampp/php/php.ini
修正内容
[mail function]
SMTP = smtp.arkgame.com
smtp_port = 25
sendmail_from = xxx@arkgame.com
sendmail_path = “\"XXX\xampp\sendmail\sendmail.exe\" -t"

2.xampp/sendmail/sendmail.ini
修正内容
[sendmail]
smtp_server = localhost
smtp_port = 25
default_domain = arkgame.com
auth_username =XXX@arkgame.com
auth_password = 你的密码

force_sender = xxx@arkgame.com

3.SSLサービスを設定する
;[gmail-smtp]
;client = yes
;accept = 127.0.0.1:25
;connect = smtp.gmail.com:465

[startnews24-smtp]
client = yes
accept = 127.0.0.1:25
connect = smtp.arkgame.com:465

4.PHPのmail()関数をテストする
$from_name = 'xxx’;
$from_email = 'xxx@arkgame.com’;
$headers = 'From: $from_name <$from_email>’;
$body = 'This is a test mail’;
$subject = 'phpのmail()関数のテスト’;
$to = 'xxx@xxx.com’;
if (mail($to, $subject, $body, $headers)) {
echo “成功!";
} else {
echo “失敗…";
}
?>

Windows10

Posted by arkgame