我已设置我的新电子邮件地址,以便能够通过我的gmail帐户,使用以下细节:
(我更改了用户名以保持域的私有性)
这里使用的代码点火器是我的配置文件,在更改托管服务之前,所有其他电子邮件都正常工作。(我也更新了发送电子邮件的发件人地址)
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://auth.smtp.1and1.co.uk';
$config['smtp_user'] = 'web@domain.com';
$config['smtp_pass'] = 'password';
$config['smtp_port'] = '465';
$config['mailtype'] = 'html';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['newline'] = "\r\n";
?>
在我看来,它应该有效,但我一直收到超时消息。这一点都没有帮助,因为它经常意味着我有错误的细节。
A PHP Error was encountered
Severity: Warning
Message: fsockopen(): unable to connect to ssl://auth.smtp.1and1.co.uk:465 (Connection timed out)
启用SSL打开,如phpinfo()所示;
发布于 2017-02-28 04:37:40
我使用了以下代码,发现我的托管公司所有相关端口都被封锁了.
下面是一些代码,以了解您是否有相同的问题:
$fp = fsockopen('localhost', 80, $errno, $errstr, 5);
if (!$fp) {
echo('port 80 is closed or blocked.');
} else {
echo('port 80 is open and available');
fclose($fp);
}
$fp = fsockopen('localhost', 25, $errno, $errstr, 5);
if (!$fp) {
echo('port 25 is closed or blocked.');
} else {
echo('port 25 is open and available');
fclose($fp);
}
$fp = fsockopen('localhost', 587, $errno, $errstr, 5);
if (!$fp) {
echo('port 587 is closed or blocked.');
} else {
echo('port 587 is open and available');
fclose($fp);
}
$fp = fsockopen('localhost', 465, $errno, $errstr, 5);
if (!$fp) {
echo('port 465 is closed or blocked.');
} else {
echo('port 465 is open and available');
fclose($fp);
}
答复显示:
port 80 is openand available
Message: fsockopen(): unable to connect to localhost:25 (Connection timed out)
Message: fsockopen(): unable to connect to localhost:587 (Connection timed out)
Message: fsockopen(): unable to connect to localhost:465 (Connection timed out)
https://stackoverflow.com/questions/42464061
复制相似问题