我必須發送電子郵件給gamil,以便在我的網站上註冊帳戶。我正在使用wamp,贏了7,codeigniter。並通過sendmail發送郵件。我已完成所有必要的更改即在php codeigniter中發送郵件給gmail
在php.ini
; For Win32 only.
SMTP = smtp.gmail.com
smtp_port = 465
; For Win32 only.
;sendmail_from = [email protected]
sendmail_path ="C:\wamp\sendmail\sendmail.exe -t"
而且在sendmail.ini
smtp_server=smtp.gmail.com
smtp_port=465
[email protected]
auth_password=mypassword
但它顯示了這個錯誤,而不是發送電子郵件。
消息:電子郵件():無法連接在 「localhost」 的端口25的郵件服務器,驗證您的 「SMTP」 和 「SMTP_PORT」 在php.ini中設置或使用的ini_set() 文件名:庫/ Email.php
它仍然在端口25上發生錯誤,但我正在使用端口465.這可能是什麼原因?我做錯了什麼? 任何幫助。
你不必使用「sendmail」程序。將php.ini重置爲前一個,並簡單地使用codeigniter發送郵件;請按照http://stackoverflow.com/a/1622996中的說明進行操作。如果您使用codeigniter,則不需要localhost服務器上的額外配置(codeigniter已經有內置的php郵件程序庫)。 – 2013-07-28 17:33:21