Apache 2.4.2、PHP 5.4.5、および MySQL 5.5 を含む XAMPP 1.8.0 を使用してローカル サーバーをアップグレードしました。MercuryMail を実行して PHP の mail() 関数でメールを送信しましたが、受信ボックスにメールが届きません。
Mozilla Thunderbird でテストしたところ、メールの送信は機能しています。また、mail() 関数はエラーなしで動作しているようです。
XAMPP インストール パスD:\xampp\phpでphp.iniを確認しました。これは下で見た
[mail function]
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
; SMTP = localhost
; smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
; sendmail_from = postmaster@localhost
; XAMPP IMPORTANT NOTE (1): If XAMPP is installed in a base directory with spaces (e.g. c:\program filesD:\xampp) fakemail and mailtodisk do not work correctly.
; XAMPP IMPORTANT NOTE (2): In this case please copy the sendmail or mailtodisk folder in your root folder (e.g. C:\sendmail) and use this for sendmail_path.
; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder)
; sendmail_path = "\"D:\xampp\sendmail\sendmail.exe\" -t"
; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the D:\xampp\mailoutput folder
; sendmail_path = "D:\xampp\mailtodisk\mailtodisk.exe"
SMTP 設定のいくつかの組み合わせを調整しました。
ホストとポートをコメントアウトしました
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP = localhost
smtp_port = 25
sendmail_pathをコメントアウトしましたが、うまくいきませんでした。メールを送信できませんでした。
; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder)
sendmail_path = "\"D:\xampp\sendmail\sendmail.exe\" -t"
繰り返しますが、別の sendmail_path をコメントアウトして、mailToDisk で動作するようにしました
; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the D:\xampp\mailoutput folder
sendmail_path = "D:\xampp\mailtodisk\mailtodisk.exe"
動作しているようですが、受信トレイにメールが届きません。D:\xampp\mailoutputに何も見つかりません
PHP メール ログ (D:\xampp\php\logs\php_mail.log) で、メールが送信されたと思われるいくつかのログ行を見つけました。
mail() on [D:\xampp\htdocs\....:127]: To: sithu@localhost.com -- Headers: MIME-Version: 1.0 Content-type: text/html; charset=text/html Return-Path:Sithu <stk@localhost.com> From: Sithu <stk@localhost.com> Reply-To: Sithu <stk@localhost.com>
mail() on [D:\xampp\htdocs\....:127]: To: test@localhost.com -- Headers: MIME-Version: 1.0 Content-type: text/html; charset=text/html Return-Path:admin@localhost.com From: admin@localhost.com Reply-To: admin@localhost.com
mail() on [D:\xampp\htdocs\....:127]: To: test@localhost.com -- Headers: MIME-Version: 1.0 Content-type: text/html; charset=text/html Return-Path:Members <admin@localhost.com> From: Members <admin@localhost.com> Reply-To: Members <admin@localhost.com>
sendmail_fromもコメントアウトしようとしましたが、うまくいきませんでした。
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = postmaster@localhost
まだ不足している構成はありますか?
[編集]
Mercury メール サーバーが実行されています。php.ini
を更新するたびに、Apache サーバーを再起動しました。