当前位置:网站首页>Alicloud: could not connect to SMTP host: SMTP 163.com, port: 25
Alicloud: could not connect to SMTP host: SMTP 163.com, port: 25
2022-04-23 20:13:00 【My brother is not strong enough to fight】
Problem description :
I wrote a monitoring program myself , adopt javamail Send monitoring information , When deployed to service execution, an error is reported :
javax.mail.MessagingException: Could not connect to SMTP host: smtp.163.com, port: 25;
DEBUG SMTP: trying to connect to host "smtp.163.com", port 25, isSSL false
javax.mail.MessagingException: Could not connect to SMTP host: smtp.163.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out (Connection timed out)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1961)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
at javax.mail.Service.connect(Service.java:295)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:196)
at com.sonkwo.bi.quartz.util.EmailUtils.sendEmail(EmailUtils.java:108)
at com.sonkwo.bi.quartz.task.RyTask.toSendCheckSyncData(RyTask.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
mean : The server could not pass host: smtp.163.com, port: 25 Connect
By hand telnet verification , Really can't connect
telnet smtp.163.com 25
Trying 220.181.15.161...
There are two solutions :
- Unseal 25 Port no. ( Not recommended );
- Use other ports (465 Port no. , recommend ).
I remind of it , Doing it azkaban I encountered this problem when sending email notification , Finally, by recompiling azkaban Source code , Only then 25 Port changed to 465 port , Specific view :【(21 Bar message ) Azkaban recompile , solve :Could not connect to SMTP host: smtp.163.com, port: 465【2022 year 01 month 10 Japan 】_ The blog of brother Xiaoqiang who can't die -CSDN Blog 】
Final solution :
modify javamail Port number in , Add the following code :
// PS: Some mailbox servers require SMTP Connection needs to use SSL Safety certification ( To improve safety , Mailbox support SSL Connect , You can open it yourself ),
// If you can't connect to the mail server , Check the console print carefully log, If there is something similar “ The connection fails , requirement SSL A secure connection ” Such mistakes ,
// Open up below /* ... */ Comment code between , Turn on SSL A secure connection .
/*
// SMTP The port of the server ( Not SSL The port of the connection is usually... By default 25, Can not add , If it's on SSL Connect ,
// It needs to be changed to SMTP The port of the server , For details, please refer to the help of the corresponding mailbox service ,
// QQ Mailbox SMTP(SLL) Port is 465 or 587, Check other mailboxes by yourself )
final String smtpPort = "465";
props.setProperty("mail.smtp.port", smtpPort);
props.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.setProperty("mail.smtp.socketFactory.fallback", "false");
props.setProperty("mail.smtp.socketFactory.port", smtpPort);
The problem is finally solved , The mail went off smoothly ...
ps: If you want to get javamail Source code , Please see 【(21 Bar message ) adopt javaMail Send E-mail _ The blog of brother Xiaoqiang who can't die -CSDN Blog 】
版权声明
本文为[My brother is not strong enough to fight]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210556213720.html
边栏推荐
- R语言ggplot2可视化分面图(facet_wrap)、使用lineheight参数自定义设置分面图标签栏(灰色标签栏)的高度
- Use test of FFT and IFFT library functions of TI DSP
- 如何在BNB鏈上創建BEP-20通證
- 仓库管理数据库系统设计
- MySQL数据库 - 单表查询(三)
- 数据库查询 - 选课系统
- 【文本分类案例】(4) RNN、LSTM 电影评价倾向分类,附TensorFlow完整代码
- 【2022】将3D目标检测看作序列预测-Point2Seq: Detecting 3D Objects as Sequences
- Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies
- Scrum Patterns之理解各种团队模式
猜你喜欢

Building googlenet neural network based on pytorch for flower recognition

Mfcc: Mel frequency cepstrum coefficient calculation of perceived frequency and actual frequency conversion

Mysql database backup scheme

STM32基础知识

C6748 software simulation and hardware test - with detailed FFT hardware measurement time

Fundamentals of programming language (2)
![[numerical prediction case] (3) LSTM time series electricity quantity prediction, with tensorflow complete code attached](/img/73/ba9fb872aa279405204c411c18f348.png)
[numerical prediction case] (3) LSTM time series electricity quantity prediction, with tensorflow complete code attached

WordPress插件:WP-China-Yes解决国内访问官网慢的方法

Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (V)

DTMF dual tone multi frequency signal simulation demonstration system
随机推荐
如何在BNB链上创建BEP-20通证
R language ggplot2 visual facet_wrap, and use the lineheight parameter to customize the height of the facet icon tab (gray label bar)
PCL点云处理之直线与平面的交点计算(五十三)
MySQL数据库 - 连接查询
Notes of Tang Shu's grammar class in postgraduate entrance examination English
图书管理数据库系统设计
Cadence Orcad Capture 批量更改元件封装功能介绍图文教程及视频演示
Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies
Mfcc: Mel frequency cepstrum coefficient calculation of perceived frequency and actual frequency conversion
Shanda Wangan shooting range experimental platform project - personal record (IV)
[target tracking] pedestrian attitude recognition based on frame difference method combined with Kalman filter, with matlab code
Compact CUDA tutorial - CUDA driver API
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)
nc基础用法4
Remote code execution in Win 11 using wpad / PAC and JScript 3
CVPR 2022 | QueryDet:使用级联稀疏query加速高分辨率下的小目标检测
R language ggplot2 visualization: ggplot2 visualizes the scatter diagram and uses geom_ mark_ The ellipse function adds ellipses around data points of data clusters or data groups for annotation
Mysql database - single table query (II)
程序设计语言基础(2)
How about CICC fortune? Is it safe to open an account