当前位置:网站首页>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->Password
after , 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
边栏推荐
猜你喜欢
【刷题】BFS题目精选
花了2晚,拿到了吴恩达@斯坦福大学的机器学习课程证书
The architect started to write a HelloWorld
[C language] address book - dynamic and static implementation
[untitled]
How is the entered query SQL statement executed?
NEW:Devart dotConnect ADO. NET
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
Interview byte, pass the exam and directly work on three sides. As a result, I found an architect to hang me?
[wp]bmzclub几道题的writeup
随机推荐
[安洵杯 2019]不是文件上传
Use of vscode software
Pyqt5 displays file names and pictures
Resolved (sqlalchemy+pandas.read_sql) attributeerror: 'engine' object has no attribute 'execution_ options‘
【web源码-代码审计方法】审计技巧及审计工具
已解决(sqlalchemy+pandas.read_sql)AttributeError: ‘Engine‘ object has no attribute ‘execution_options‘
An elegant program for Euclid‘s algorithm
Deflocculant aminoiodotide eye drops
Containerd series - detailed explanation of plugins
Assembly - getting started
Is there a sudden failure on the line? How to make emergency diagnosis, troubleshooting and recovery
Easy processing of ten-year futures and stock market data -- Application of tdengine in Tongxinyuan fund
About the recent experience of writing questions
Clickhouse同步mysql(基于物化引擎)
[wp][入门]刷弱类型题目
在线文本行固定长度填充工具
[understand series after reading] 6000 words teach you to realize interface automation from 0 to 1
BDF application - topology sequence
ABP vNext microservice architecture detailed tutorial - distributed permission framework (Part 2)
MySQL winter vacation self-study 2022 11 (9)