zoukankan      html  css  js  c++  java
  • smtp 发送邮件类出错

    1、接收邮箱受限,部分企业内部邮箱不接收

    2、SMTP服务器信息填写错误。

    $smtpserver = "smtp.139.com";   

    3、SMTP服务器的用户邮箱和用户名错误(例如邮箱是yaradish@139.com,请分别试一下“yaradish”、“yaradish@139.com”,因为部分只需输入@前面的,有些邮箱要输入完整的)

    4、密码错误(注意的是要填写明文的密码)

    5、Transport发送对象的connect函数中的主机名不一致,即connect中的host("smtp.xxx.com")要跟发件人的host相同。

    其他注意事项:

    1、代码里面在做正则匹配时,注意添加模式修正符;网上很多版本里面没有 "/ /";

    2、在终端执行时,需要加上时间设置,否则报错

      PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.

    date_default_timezone_set("America/Los_Angeles");

     3、在做测试的时候打开debug,查看返回的结果

    $Smtp->debug = true;

     以下是发送成功返回的信息

  • 相关阅读:
    几种跨平台解决方案:React Native、Kotlin、Flutter、Swift
    vue组件化
    flutter学习笔记(合集)
    sessionStorage获取用户行为
    什么是深度学习?
    javascript原生dom的那些事儿
    对象的创建
    初识requirejs
    使用vue-cli3快速构建项目
    python16_day40【数据结构】
  • 原文地址:https://www.cnblogs.com/yaradish/p/10038046.html
Copyright © 2011-2022 走看看