outlook邮箱无法收到邮件的坑

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_41198398/article/details/82218601

因开发中遇到需要发送邮件到outlook企业邮箱。

一:项目框架使用的是php + phalapi

二: 安装和配置

从 PhalApi-Library 扩展库中下载获取 PHPMailer 包,如使用:

$ git clone https://git.oschina.net/dogstar/PhalApi-Library.git

然后把 PHPMailer 目录复制到 ./PhalApi/Library/ 下,即:

$ cp ./PhalApi-Library/PHPMailer/ ./PhalApi/Library/ -R

到此安装完毕!接下是插件的配置。

(1)邮箱配置

需要在 ./Config/app.php 配置文件中追加以下配置:

3.3.3 使用

如下代码示例:

require_once './init.php';

DI()->loader->addDirs('Library');

$mailer = new PHPMailer_Lite(true);
$mailer->send('[email protected]', 'Test PHPMailer Lite', 'something here ...');

Library/PHPMailer/Lite.php

一开始以为是qq邮箱问题,然后换了163邮箱。也不行,最后将这个isHtml参数改成false,outlook邮箱就可以接受正常邮件。

原因大概是企业邮箱,对邮件的内容格式做了限制(猜想!)

猜你喜欢

转载自blog.csdn.net/qq_41198398/article/details/82218601