当前位置:网站首页>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
边栏推荐
- Basic knowledge of tuples
- [an Xun cup 2019] not file upload
- [system security] ten thousand words summary system virtualization container bottom layer principle experiment
- ABP vNext microservice architecture detailed tutorial - distributed permission framework (Part 1)
- English essential vocabulary 3400
- 花了2晚,拿到了吴恩达@斯坦福大学的机器学习课程证书
- 反絮凝剂-氨碘肽滴眼液
- Plasticscm enterprise crack
- Special Edition: spreadjs v15.1 vs spreadjs v15.0
- 测试开发是什么?为什么现在那么多公司都要招聘测试开发?
猜你喜欢
Basic knowledge of tuples
[C language] address book - dynamic and static implementation
PlasticSCM 企业版Crack
Redis source code analysis: redis cluster
Some enterprise interview questions of unity interview
Containerd series - detailed explanation of plugins
一文带你了解BI的前世今身与企业数字化转型的关系
JWT vulnerability recurrence
在线SQL转Excel(xls/xlsx)工具
Clickhouse物化视图
随机推荐
我就一写代码的,王总整天和我谈格局...
Redis source code analysis: redis cluster
Interview byte, pass the exam and directly work on three sides. As a result, I found an architect to hang me?
MySQL winter vacation self-study 2022 11 (10)
ABP vNext microservice architecture detailed tutorial - distributed permission framework (Part 2)
【web源码-代码审计方法】审计技巧及审计工具
How is the entered query SQL statement executed?
反絮凝剂-氨碘肽滴眼液
Enterprise level: spire Office for . NET:Platinum|7.7. x
UI自動化測試從此告別手動下載瀏覽器驅動
As soon as I write the code, President Wang talks with me about the pattern all day
[数组]566. 重塑矩阵-简单
【无标题】
UE4 DMX和grandMA2 onPC 3.1.2.5的操作流程
Google Chrome CSS will not update unless the cache is cleared - Google Chrome CSS doesn't update unless clear cache
MySQL winter vacation self-study 2022 11 (9)
Basic knowledge of tuples
线程基础知识
Clickhouse同步mysql(基于物化引擎)
Soul 3: what is interface testing, how to play interface testing, and how to play interface automation testing?