我有我的PHP一個問題:我想用XAMPP 我的配置發送簡單的郵件php..I是: 的php.ini: 只有sendmail和mail.add_x_header沒有評論發送郵件用PHP
; For Win32 only.
; http://php.net/smtp
;SMTP = smtp.gmail.com
; http://php.net/smtp-port
;smtp_port = 587
sendmail_path = "C:\xampp\sendmail\sendmail.exe\" -t"
mail.add_x_header = Off
sendmail.ini:
smtp_server=smtp.gmail.com
;smtp port (normally 25)
smtp_port=587
smtp_ssl=true
[email protected]
auth_password=mypassword
和index.php文件
<?php
$subject="Hi There!!";
$to="[email protected]";
$body="This is my demo email sent using PHP on XAMPP";
if (mail($to,$subject,$body))
echo "Mail sent successfully!";
else
echo "Mail not sent!";
?>
它運行沒有錯誤,但郵件不來...我的錯誤在哪裏?PLIZ幫助我
您是否有防火牆問題?你有沒有檢查你的PHP日誌? –
你確定你php.ini'sendmail_path =「C:\ xampp \ sendmail \ sendmail.exe \」-t「'看起來不錯嗎?我懷疑你有一個不平衡的報價或一些非反斜槓!試試'sendmail_path = C: /xampp/sendmail/sendmail.exe -t' –
給這個帖子試一試:[這裏](http://stackoverflow.com/questions/4948687/xampp-sendmail-using-gmail-account) – MikeF