SMTP Error: Could not connect to SMTP host.
2013-10-09 21:12
711 查看
使用 PHPmailer类发送邮件的时候出现SMTP Error: Could not connect to SMTP host. (链接不到SMTP服务器)
以及后来遇到的Could not instantiate mail function.问题
把$this->Mailer='smtp' 改成大写 $this->Mailer='SMTP'
注意:这里不止一处,下文用class.phpmailer.php中
这里的小写也要大写
ps:如果使用qq邮箱或者Gmail邮箱发送,服务器必须支持SSL php.ini文件用改的 extension=php_openssl.dll前面去掉“;”
如果还是不行,看看phpinfo();sockets 有没有打开,没有的话 extension=php_sockets.dll 前面也去掉“;”
以及后来遇到的Could not instantiate mail function.问题
把$this->Mailer='smtp' 改成大写 $this->Mailer='SMTP'
注意:这里不止一处,下文用class.phpmailer.php中
switch($this->Mailer) { case 'sendmail': return $this->SendmailSend($header, $body); case 'smtp': return $this->SmtpSend($header, $body); default: return $this->MailSend($header, $body); }
这里的小写也要大写
ps:如果使用qq邮箱或者Gmail邮箱发送,服务器必须支持SSL php.ini文件用改的 extension=php_openssl.dll前面去掉“;”
如果还是不行,看看phpinfo();sockets 有没有打开,没有的话 extension=php_sockets.dll 前面也去掉“;”
相关文章推荐
- smarty、thinkphp中的html加载其他的html文件的方式
- PHP在CLI模式下无法连接mysql数据库
- 非常实用的15款开源PHP类库
- PHP留言板(实例)
- WordPress Woopra plugin remote PHP arbitrary code execution exploit.
- php array key 的存储规则
- 关于php进行简单的防盗链!
- Ubuntu下的PHP安装CURL组件
- php添加FreeType 库支持
- vsftp开启
- 编译PHP的配置
- PHP商品倒计时
- PHP设计模式
- InputStreamReader & OutputStreamWriter
- php 登陆验证
- phpcms v9会员投稿不能删除问题处理
- php以及Yii里面的常量收集
- PHP开源建站程序一览
- PHP mkdir新建目录
- PHP 5.4 中经 htmlspecialchars 转义后的中文字符串为空的问题