当前位置:网站首页>Phpmailer reported an error: SMTP error: failed to connect to server: (0)
Phpmailer reported an error: SMTP error: failed to connect to server: (0)
2022-07-05 03:57:00 【Summer is already slightly cool】
One 、 explain
- According to this article PHPMailer Use , Configured with
$mail->Username,$mail->Passwordafter , The execution error is as follows :
2021-09-01 12:22:37 SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Error
Two 、 solve
1、 Ignore ssl authentication ( My is for this reason )
- stay
$mail = new PHPMailer();Add the following code after
// Instantiation PHPMailer Core class
$mail = new PHPMailer();
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
...
2、 Set the port to bit 25 , Don't use SSL,465( Other possible reasons )
- hold
// Set to use ssl Encrypted login authentication
$mail->SMTPSecure = 'ssl';
// Set up ssl Connect smtp The remote server port number of the server
$mail->Port = 465;
- Change it to
$mail->Port = 25;
3、 ... and 、 His shan zhishi
边栏推荐
- [an Xun cup 2019] not file upload
- v-if VS v-show 2.0
- DECLARE_ WAIT_ QUEUE_ HEAD、wake_ up_ Interruptible macro analysis
- provide/inject
- [charging station]_ Secular wisdom_ Philosophical wisdom _
- 测试开发是什么?为什么现在那么多公司都要招聘测试开发?
- glibc strlen 实现方式分析
- Nmap使用手册学习记录
- Learning notes of raspberry pie 4B - IO communication (I2C)
- 【刷题】BFS题目精选
猜你喜欢

How to define a unified response object gracefully
![[wp]bmzclub writeup of several questions](/img/15/2838b93a605b09d3e2996f6067775c.png)
[wp]bmzclub writeup of several questions

Special Edition: spreadjs v15.1 vs spreadjs v15.0
![[wp][introduction] brush weak type questions](/img/d0/9eb3ade701057837d98e4a20082a10.png)
[wp][introduction] brush weak type questions
![[web source code code code audit method] audit skills and tools](/img/7c/2c26578da084b3cd15d8f252b0e132.png)
[web source code code code audit method] audit skills and tools

NEW:Devart dotConnect ADO. NET

@Transactional 注解导致跨库查询失效的问题
![[数组]566. 重塑矩阵-简单](/img/3c/593156f5bde67bd56828106d7bed3c.png)
[数组]566. 重塑矩阵-简单

Operation flow of UE4 DMX and grandma2 onpc 3.1.2.5

How to use jedis of redis
随机推荐
[move pictures up, down, left and right through the keyboard in JS]
Redis6-01nosql database
英语必备词汇3400
为什么百度、阿里这些大厂宁愿花25K招聘应届生,也不愿涨薪5K留住老员工?
IronXL for . NET 2022.6
Necessary fonts for designers
Clickhouse同步mysql(基于物化引擎)
How to make the listbox scroll automatically when adding a new item- How can I have a ListBox auto-scroll when a new item is added?
C # use awaiter
[summary of two registration methods]
灵魂三问:什么是接口测试,接口测试怎么玩,接口自动化测试怎么玩?
Solve the problem that sqlyog does not have a schema Designer
@Transactional 注解导致跨库查询失效的问题
Easy processing of ten-year futures and stock market data -- Application of tdengine in Tongxinyuan fund
【刷题】BFS题目精选
Installation of postman and postman interceptor
【做题打卡】集成每日5题分享(第三期)
Multimedia query
输入的查询SQL语句,是如何执行的?
Basic function learning 02