PHPMailer出现SMTP connect() failed.
很可能是端口问题,最好把$mailer->SMTPSecure和$mailer->Port分别设置为ssl与465或者tls与587,否则某些浏览器不接受不安全的链接,导致$mailer->send()时非常慢,从而导致SMTP connect() failed(我最初就是没有设置$mailer->SMTPSecure和$mailer->Port,然后在某些主机上发不出邮件)
顺便介绍一个不规范的异步处理思路:
当主机上没有redis和队列组件时,可以把发送邮件单独些写成一个脚本,并由system()命令调用:
system("php sendMail.php '" . $parameters . "' >/dev/null &");
传入我们想要参入,如邮箱地址、标题、内容等
一定不要忘记最后的“&”,否则不在系统后台运行,php会等待邮件发送完成,那就不是异步了
这种方法可以作为异步的临时方案
PHPMailer出现SMTP connect() failed.的更多相关文章
- PHPMailer发送邮件失败:SMTP connect failed
标签: PHPMailersmtp邮件服务器邮件发送失败 2015-05-22 19:29 1755人阅读 评论(0) 收藏 举报 分类: Apache php+mysql(2) 版权声明:本文为博主 ...
- phpmailer的SMTP ERROR: Failed to connect to server: 10
请问,我在win7上学习使用phpmailer时,出现这种错误怎么处理啊? SMTP ERROR: Failed to connect to server: (0) SMTP connect() fa ...
- phpmailer SMTP connect() failed的解决方法
使用PHPMailer发邮件的时候,经常出现本地可以发送,上传到服务器就发送失败了.老是提示SMTP connect() failed 今天我也遇到了这样的问题,用的是QQ的邮箱服务器,查了下资料,很 ...
- 紧急求助!配置SMTP插件出错,SMTP connect() failed
http://bbs.csdn.net/topics/390848222 我来挖个坟.我知道问题所在了,只要你们本地或服务器上环境中只要确保开启了php_openssl 跟 php_socket等扩展 ...
- linux下phpmailer发送邮件出现SMTP ERROR: Failed to connect to server: (0)错误
转自:https://www.cnblogs.com/raincowl/p/8875647.html //Create a new PHPMailer instance $mail = new PHP ...
- linux 下 用phpmailer类smtp发送邮件始终不成功,提示:ERROR: Failed to co
https://zhidao.baidu.com/question/509191264.html?fr=iks&word=PHPMailerSMTP+connect()+failed& ...
- 使用phpmailer插件发邮件失败提示:SMTP -> ERROR: Failed to connect to server: Connection timed out (110) smtp connect() failed;
一个邮件发送问题,整整弄了我一周时间,起因是这样的,之前弄的一个网站,需要在邮箱里面认证之后才可以注册成功.网站上线了差不多一年之后,客户突然跟我说,网站不能注册了,然后我就查看了一下代码. 发现报这 ...
- 使用phpmailer发送smtp邮件时提示 SMTP Error: Could not authenticate 错误
使用phpmailer发送smtp邮件时提示 SMTP Error: Could not authenticate 错误 这个错误是验证出现错误, $mail->Port = 25; //SMT ...
- [nginx] connect() failed (111: Connection refused) while connecting to upstream, client: 101.18.123.107, server: localhost,
nginx一直报错, 2016/12/02 10:23:19 [error] 1472#0: *31 connect() failed (111: Connection refused)while c ...
随机推荐
- centos 升级python3
升级pip3 wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py 升级python3 yum install epel-r ...
- 在linux系统安装tomcat后,bin文件下startup.sh启动不
Linux里的tomcat下的 bin ,没法执行, 可直接到 bin 目录下 ,执行 chmod 777 * 就可以了. [srmdev@mvxl0793 bin]$ chmod 777 * ...
- 【PL/SQL基础知识】结构
1.pl/sql块的结构 declare --声明的变量.类型.游标 begin --程序的执行部分(类似于java的main()方法) exception --针对begin块中出现的异常 ---w ...
- 结构体的数据对齐 #pragma浅谈
之前若是有人拿个结构体或者联合体问我这个结构占用了多少字节的内存,我一定觉得这个人有点low, 直到某某公司的一个实习招聘模拟题的出现,让我不得不重新审视这个问题, 该问题大致如下: typedef ...
- alias重命名命令
升级了openssh后,发现ctrl+l忽然无法清屏了. 如果需要清屏的话,就得执行clear,但我更喜欢简单粗暴的做法,于是想起alias命令 方式一: 如果只想在当前终端生效(exit该窗口终端后 ...
- BNF
Backus-Naur Form, 巴科斯-诺尔 范式:一种描述高级语言语法的表示法. BNF 符号概览 符号 描述 ::= 该符号左边的元素被该符号右边的结构所定义 *: 该符号前面的结构可以重复零 ...
- Redis中存入存储的编码方式不一致解决问题
在利用redis缓存的时候,存入的数据与取出的数据编码方式不一致解决办法. from redis import StrictRedis #ecoding = 'utf-8',默认解码方式为bytes, ...
- enumerate 模块
import os list1 = ['a','b','c'] for index,aph in enumerate(list1) #把可遍历对象的数据以及其索引取出分别赋值给index,aph pr ...
- 概念:dependency injection, IOC, vs callback
callback function as a dependency of the object that it is being passed into. DI is the process of p ...
- List进行排序
使用Java中提供的对集合进行操作的工具类Collections,其中的sort方法,重写比较方法 /** * 根据序号对列席人进行排序 * @param lxrUser * @return */ p ...