我使用OpenShift和我有問題發送電子郵件。openshift電子郵件發送從終端,但不是從PHP
通過SSH登錄時,它工作正常,爲如:
echo 「Test from Postfix」 | mail -s 「Test1″ [email protected]
但是,如果我想從PHP代碼發送電子郵件這樣的:
if (mail ('[email protected]', "Test Postfix", "Test mail from postfix", "From: [email protected]"))
echo "mail sent succesfully";
else
echo "couldn't send mail";
它寫道:「郵件發送成功地「,但沒有電子郵件到達:( 沒有標題也試過,但它是一樣的
檢查設置爲smtp ,sendmail_path,sendmail_from和SMTP_PORT,都與php -i
和phpinfo()
。他們都是一樣的:
- SMTP_PORT = 25
- sendmail_path =
- SMTP =本地主機(也試圖與函數ini_set( 「SMTP」,「SMTP(即我與sendmail的獲取路徑)。 mysmtp.com「))。
error.log不包含錯誤。 我找不到email.logs。
你能提出一些解決方案嗎?