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 ...
随机推荐
- I/O简介
用户空间是常规进程所在区域.JVM就是常规进程,驻守于用户空间.用户空间是非特权区域,在该区域执行的代码不能直接访问硬件设备. 内核空间是操作系统所在区域.内核代码有特别的权利:它能与设备控制器通讯, ...
- 【leetcode】415. Add Strings
problem 415. Add Strings solution: class Solution { public: string addStrings(string num1, string nu ...
- 【开发遇到的问题】Spring Mvc使用Jackson进行json转对象时,遇到的字符串转日期的异常处理(JSON parse error: Can not deserialize value of type java.util.Date from String[)
1.问题排查 - 项目配置 springboot 2.1 maven配置jackson - 出现的场景: 服务端通过springmvc写了一个对外的接口,查询数据中的表,表中有一个字段属性是时间戳,返 ...
- [LeetCode&Python] Problem 744. Find Smallest Letter Greater Than Target
Given a list of sorted characters letters containing only lowercase letters, and given a target lett ...
- leetcode 846.Hand of Straights
对于一个数组中的数分为W组且在每一组内的数是连续存在的. 考虑使用map映射来记录每个数的个数的,并且对于数组中的数进行从小到大的排列的.同时每次需要更新最开始的那个起始数的,可能是以及出现的也可能是 ...
- Flex布局-项目的属性
Flex项目有以下6个属性: order flex-grow flex-shrink flex-basis flex align-self order属性定义项目的排列顺序.数值越小,排列越靠前,默认 ...
- hive入门学习线路指导
hive被大多数企业使用,学习它,利于自己掌握企业所使用的技术,这里从安装使用到概念.原理及如何使用遇到的问题,来讲解hive,希望对大家有所帮助.此篇内容较多:看完之后需要达到的目标1.hive是什 ...
- python gevent自动挡的协程切换。
import gevent def func(): print('running func 111')#第一步运行 gevent.sleep(2)#切换到下个协程 print('running fun ...
- range的新发现
正向打印的时候 for i in range(2): print(i) 打印的结果 0 1 反向的时候 for i in range(2,-1,-1): print(i) 2 1 0 for i in ...
- Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
To fix it, just kill the apt process. ps -aux | grep -i apt sudo kill -9 "the process ID"