我正在尝试设置一个注册表,向新成员发送欢迎电子邮件。这个表单在我的本地主机上运行得很好,但是当我尝试将它上传到远程服务器时,当使用submit按钮时,我在页面顶部得到一个"Connection Timed Out“错误。
我使用的是老师的远程服务器,所以我对该服务器的访问权限是有限的。
$mailhost = 'smtp.gmail.com';
$mailconfig = array('auth' => 'login',
'username' => 'myemail@gmail.com',
'password' => 'xxxxxxxx',
'ssl' => 'ssl',
'port' => '465');
$transport = new Zend_Mail_Transport_Smtp($mailhost, $mailconfig);
Zend_Mail::setDefaultTransport($transport);
$mail = new Zend_Mail('UTF-8');
$mail->setBodyText($text, 'UTF-8');
$mail->setBodyHtml($html, 'UTF-8');
$mail->setFrom('myemail@gmail.com', 'from me');
$mail->addTo($email, $name);
$mail->setSubject('Welcome to the page');
$success = $mail->send();
if(!$success) {
$errors = true;
}发布于 2012-05-18 04:18:59
我发现我的老师的服务器阻塞了smtp,这导致了超时错误。
https://stackoverflow.com/questions/10377533
复制相似问题