当前位置:网站首页>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
边栏推荐
- IronXL for . NET 2022.6
- Yuancosmic ecological panorama [2022 latest]
- Enterprise level: spire Office for . NET:Platinum|7.7. x
- 【web審計-源碼泄露】獲取源碼方法,利用工具
- 测试开发是什么?为什么现在那么多公司都要招聘测试开发?
- On the day 25K joined Tencent, I cried
- [PHP features - variable coverage] improper use, improper configuration and code logic vulnerability of the function
- 优先使用对象组合,而不是类继承
- Smart pointer shared_ PTR and weak_ Difference of PTR
- [wp]bmzclub几道题的writeup
猜你喜欢
EasyCVR平台出现WebRTC协议视频播放不了是什么原因?
Test d'automatisation de l'interface utilisateur télécharger manuellement le pilote du navigateur à partir de maintenant
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
[system security] ten thousand words summary system virtualization container bottom layer principle experiment
Redis之Jedis如何使用
【web源码-代码审计方法】审计技巧及审计工具
25K 入职腾讯的那天,我特么哭了
Web components series (VII) -- life cycle of custom components
程序员的视力怎么样? | 每日趣闻
C # use awaiter
随机推荐
Containerd series - detailed explanation of plugins
【软件逆向-基础知识】分析方法、汇编指令体系结构
【web審計-源碼泄露】獲取源碼方法,利用工具
Necessary fonts for designers
一文带你了解BI的前世今身与企业数字化转型的关系
函数基础学习02
C # use awaiter
JWT vulnerability recurrence
speed or tempo in classical music
[summary of two registration methods]
MySQL winter vacation self-study 2022 11 (10)
反絮凝剂-氨碘肽滴眼液
Nmap使用手册学习记录
How rem is used
【web源码-代码审计方法】审计技巧及审计工具
【看完就懂系列】一文6000字教你从0到1实现接口自动化
[system security] ten thousand words summary system virtualization container bottom layer principle experiment
C语言课设:影院售票管理系统
Quick start of UI component development of phantom engine [umg/slate]
EasyCVR平台出现WebRTC协议视频播放不了是什么原因?