我試圖通過1and1託管的codeigniter網站上的SMTP發送電子郵件。當我在本地執行它時,它運行良好,但只要從我的1and1主機嘗試它,我會收到錯誤消息。在1and1主機上使用Codeigniter發送SMTP電子郵件
這裏是我的配置:
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'auth.smtp.1and1.fr'; //i'm in france and this is the SMTP server adress 1and1 gave me.
$config['smtp_port'] = 25;
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'password';
,這裏是錯誤:
The following SMTP error was encountered: 110 Connection timed out
Unable to send data: AUTH LOGIN
Failed to send AUTH LOGIN command. Error:
Unable to send data: MAIL FROM:
from:
The following SMTP error was encountered:
Unable to send data: RCPT TO:
to:
The following SMTP error was encountered:
Unable to send data: DATA
data:
The following SMTP error was encountered:
Unable to send data: //details about my message i removed
Unable to send data: .
The following SMTP error was encountered:
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
然後我試圖使用smtp.1and1.com而不是auth.smtp.1and1.fr。令人驚訝的是,它的工作,但它需要30秒執行! (並在我的本地主機上它是瞬間的)。
有什麼建議嗎?