SMTP Error: Could not connect to SMTP host的解决办法
SMTP Error: Could not connect to SMTP host.的解决办法
博客邮件 Could not connect to SMTP host问题原因:PHPmailer里有一个判断的函数。
public function IsSMTP() { $this->Mailer = 'SMTP'; } switch($this->Mailer) {case 'sendmail': return $this->SendmailSend($header, $body); case 'smtp'://由于SMTP和smtp不相等 所以选择的是下面MailSend发送邮件 并不是使用smtp发送邮件 return $this->SmtpSend($header, $body); default: return $this->MailSend($header, $body);
解决方法:
在 class.phpmailer.php 中,将
function IsSMTP() { $this->Mailer = 'smtp'; }
改成:
function IsSMTP() { $this->Mailer = 'SMTP'; }
独行者
谢谢分享,果断解决博客不能发送邮件的问题。
沈军
@独行者:我也是刚刚遇到SMTP Error: Could not connect to SMTP host这个问题,总结分享给大家。