有上XAMPP(Windows安裝)使用Sendmail的一些問題 - 當我嘗試測試電子郵件(請參見下面的腳本)sendmail.exe」 -t」不被識別爲一個內部或外部命令
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$from = "[email protected]";
$to = "[email protected]";
$subject = "PHP Mail Test script";
$message = "This is a test to check the PHP Mail functionality";
$headers = "From:" . $from;
mail($to,$subject,$message, $headers);
echo "Test email sent";
?>
在運行此腳本,並檢查error.log中我得到以下錯誤:
'D:\Xampp2\sendmail\sendmail.exe" -t' is not recognized as an internal or external command,
operable program or batch file.
我的設置看起來像這樣:
的php.ini
XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP = smtp.gmail.com
smtp_port = 465
sendmail_from = [email protected]
sendmail_path="D:\xampp2\sendmail\sendmail.exe\" -t"
Sendmail.ini
smtp_server= smtp.gmail.com
smtp_port= 465
smtp_ssl= auto
[email protected]
auth_password=(HIDDEN)
我一直在使用的端口的嘗試:587,465,25爲SMTP_PORT區域。 相當難倒這一個 - 任何想法請嗎? :)
什麼是流浪逃脫'\「'本來雙引號做 – mario
我可以問你的意思是遺憾? ?:) –
我發現你的意思,對不起,它應該是:「\」D:\ xampp2 \ sendmail \ sendmail.exe \「-t」 - 我從:http://stackoverflow.com/questions/ 15965376/how-to-configure-xampp-to-send-mail-from-localhost –