[Email] Use exmail.qq.com SMTPS protocol to send email from Alibaba Cloud Cloud

For security reasons, Alibaba Cloud blocks outbound traffic on TCP port 25 by default. that You cannot connect to external addresses TCP port 25 from Alibaba Cloud Cloud servers (ECS).

Background Information

Blocking the outbound direction of TCP 25 port may affect your connection to the SMTP server of a third-party mail service provider through TCP 25 port to send external mail. If you need to use the cloud server on Alibaba Cloud to send external emails, it is recommended that you use Alibaba Cloud Mail products or use the 465 port provided by a third-party mail service provider.

Note If there are special scenarios, you must use TCP port 25 on the cloud server for external connections. Please submit a port 25 unblocking application in the security management and control platform. Alibaba Cloud will review the application reason you submitted and notify you of the review result by email.


Remember to replace the content within {{ }} with your prefer value.

The from_address and user must be the same.

from_address: {{ .Values.smtp.from_address }} # [email protected]
host: smtp.exmail.qq.com
port: 465 # not 25
use_tls: {{ .Values.smtp.use_tls }} # true or false
user: {{ .Values.smtp.user }} # [email protected]
password: {{ .Values.smtp.password }}
enable_replies: false # or true


smtp or smtps.

The $MAIL_URL is 'smtp://...:465'.  You probably want 'smtps://' (The 's' enables TLS/SSL) since '465' is typically a secure port. undefined 

Use smtps protocols and 465 port instead of smtp and 25.

Error code 501

Exception in defer callback: Error: Mail command failed: 501 ϵͳÒÑÇ¿ÖÆ¿ªÆôÕʺÅÉý¼¶ÉèÖã¬ÇëµÇ¼exmail.qq.com°ó¶¨Î¢ÐÅ

This is because Tencent Enterprise Mailbox forced to enable the security certification before send email from client.

You can log in Tencent Enterprise Mailbox Administrator Web UI, find the sender’s account, and edit it to disable enforce secure login option.


[1] 腾讯企业邮箱 - https://exmail.qq.com/

[2] TCP 25端口解封申请 - 阿里云 - https://help.aliyun.com/document_detail/56130.html

[3] 阿里云服务器不能发邮件禁用25端口的三种解决方法_weixin_30258027的博客-CSDN博客 - https://blog.csdn.net/weixin_30258027/article/details/95448730?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.control