一、总结

一句话总结:

端口号port 改成 465,加密方式 encryption 改用 ssl

 

 

 

二、Connection could not be established with host smtp.163.com

转自或参考:Connection could not be established with host smtp.163.com 阿星小栈
https://blog.csdn.net/u010244476/article/details/83190154

 

laravel阿里云屏蔽25,无法发送邮件的解决方案

本地测试邮件可以发送成功,但是部署在阿里云服务器上之后,并且在安全组中配置了25端口的出入后还是不行。

原因是:

阿里云服务器封禁了25

解决办法

  端口号port 改成 465

  加密方式 encryption 改用 ssl

也就是加入了SSL验证

 

阿里云服务器发送邮件:Connection could not be established with host smtp.qq.com [Connection timed out #110]

 

 

 

三、laravel中成功配置实例

阿里云服务器发送邮件:Connection could not be established with host smtp.qq.com [Connection timed out #110]

 

 

 

 

三、阿里云服务器25邮件端口问题

转自或参考:阿里云服务器25邮件端口问题
https://blog.csdn.net/weixin_30780649/article/details/101627176


配置示例:

spring:
  mail:
    host: smtp.163.com
    username: 1111111@163.com
    password: aaaaaaaa
    default-encoding: UTF-8
    properties:
      mail:
        smtp:
          auth: true
          ssl:
            trust: smtp.163.com
          socketFactory:
            class: 'javax.net.ssl.SSLSocketFactory'
            port: 465
          starttls:
            enable: true
            required: true

转载于:https://www.cnblogs.com/javabg/p/11398950.html

 

四、阿里云服务器邮件发送

转自或参考:阿里云服务器邮件发送
https://www.cnblogs.com/eye-like/p/10103783.html

一个邮件发送的功能,本机调试无问题,但发布到阿里云服务器后邮件发送功能失败。

网上查了下大概是说阿里云把发送邮件的25端口禁用掉了

阿里云服务器发送邮件:Connection could not be established with host smtp.qq.com [Connection timed out #110]

那么解决方式一就是向阿里云申请开放25端口,但具体如何申请,并未深入操作。

解决方式二:使用邮件服务商的加密端口。

但是当使用465端口时,先后试验过smtp.mxhichina.com(阿里企业邮箱)、smtp.163.com(163邮箱)、smtp.qq.com(qq邮箱)三种发送方式,均失败!

再尝试考虑SSL加密SMTP通过587端口进行发件,发送成功。

以下为配置及源码

<?xml version="1.0" encoding="utf-8"?>
<xml>
  <!--收件人邮箱地址-->
  <ConsigneeAddress>pro@163.com</ConsigneeAddress>
  <!--抄送邮箱地址,多个邮箱间用'|'分割-->
  <BccAddress></BccAddress>
  <!--收件人名称-->
  <ConsigneeName>浦泓医疗</ConsigneeName>
  <!--发件人名称-->
  <ConsigneeHand>微商城</ConsigneeHand>
  <!--邮件主题-->
  <ConsigneeTheme>睛彩眼界商城订单</ConsigneeTheme>
  <!--发件邮件服务器的Smtp设置-->
  <SendSetSmtp>smtp.qq.com</SendSetSmtp>
  <!--发件人的邮件-->
  <SendEmail>124@qq.com</SendEmail>
  <!--发件人的邮件密码-->
  <SendPwd>boblunxyluwdjjbh</SendPwd>
  <!--发件端口号-->
  <port>587</port>
  <!--邮件内容-->
  <SendContent>您有新的订单消息</SendContent>
  <!--后台管理地址-->
  <serverAddress>http://xxx/admin/login</serverAddress>
</xml>
邮箱配置

相关文章: