当前位置:网站首页>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
边栏推荐
- 英语必备词汇3400
- About the recent experience of writing questions
- [数组]566. 重塑矩阵-简单
- [vérification sur le Web - divulgation du code source] obtenir la méthode du code source et utiliser des outils
- Solve the problem that sqlyog does not have a schema Designer
- 【PHP特性-变量覆盖】函数的使用不当、配置不当、代码逻辑漏洞
- C # use awaiter
- @The problem of cross database query invalidation caused by transactional annotation
- Pyqt5 displays file names and pictures
- glibc strlen 实现方式分析
猜你喜欢
[vérification sur le Web - divulgation du code source] obtenir la méthode du code source et utiliser des outils
Enterprise level: spire Office for . NET:Platinum|7.7. x
Yuancosmic ecological panorama [2022 latest]
[luat-air105] 4.1 file system FS
Timing manager based on C #
EasyCVR更改录像存储路径,不生成录像文件如何解决?
[安洵杯 2019]不是文件上传
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
How to use jedis of redis
Thread Basics
随机推荐
NEW:Devart dotConnect ADO.NET
测试开发是什么?为什么现在那么多公司都要招聘测试开发?
【web源码-代码审计方法】审计技巧及审计工具
[charging station]_ Secular wisdom_ Philosophical wisdom _
UI自動化測試從此告別手動下載瀏覽器驅動
Basic knowledge of tuples
How is the entered query SQL statement executed?
[system security] ten thousand words summary system virtualization container bottom layer principle experiment
A brief introduction to the behavior tree of unity AI
DECLARE_ WAIT_ QUEUE_ HEAD、wake_ up_ Interruptible macro analysis
Why is there a reincarnation of 60 years instead of 120 years in the tiangan dizhi chronology
[vérification sur le Web - divulgation du code source] obtenir la méthode du code source et utiliser des outils
Resolved (sqlalchemy+pandas.read_sql) attributeerror: 'engine' object has no attribute 'execution_ options‘
Operation flow of UE4 DMX and grandma2 onpc 3.1.2.5
Rust区块琏开发——签名加密与私钥公钥
Blue Bridge Cup single chip microcomputer -- PWM pulse width modulation
Deep learning - LSTM Foundation
Smart pointer shared_ PTR and weak_ Difference of PTR
【软件逆向-基础知识】分析方法、汇编指令体系结构
【刷题】BFS题目精选