【发布时间】:2018-05-05 00:40:17
【问题描述】:
在 Network Solutions 共享主机包上使用https://github.com/PHPMailer/PHPMailer 有一个基本联系表。
// start the mail request basics
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->Debugoutput = 'html';
$mail->SMTPAuth = true; // authentication enabled
$mail->Host = 'ssl://smtp.gmail.com';
$mail->Port = 587;
$mail->IsHTML(true);
$mail->Username = 'my_gmail_account@gmail.com';
$mail->Password = '*******';
一切都在本地(在我的计算机上)找到并且表单发送电子邮件,但是当我将此 php 文件上传到我们的网络解决方案托管时,我收到以下错误。
SMTP ERROR: Failed to connect to server: Connection timed out (110)
SMTP connect() failed.
我的邮件设置有问题吗?还有其他人在网络解决方案共享主机上使用 PHP 邮件成功吗?
【问题讨论】:
-
有没有找到解决方案? 5 年后遇到同样的问题。
标签: php contact-form