php - 未发送到 office365 邮件客户端的电子邮件
问题描述
我想从我的 laravel 应用程序发送一些电子邮件。电子邮件会发送到 Gmail、Yahoo 和一些个人电子邮件帐户,但不会将电子邮件发送到 office 365 电子邮件帐户。在其他服务中,收件箱文件夹中收到的电子邮件。
我尝试了其他一些 SMTP 服务器(Google 和我的托管 SMTP),但不会从 Laravel 应用程序发送任何电子邮件。
这是我的 .env 文件:
MAIL_DRIVER=smtp
MAIL_HOST=cpanel2.mylittledatacenter.com
MAIL_PORT=465
MAIL_USERNAME=info@schoolearn.ir
MAIL_PASSWORD=*****
MAIL_ENCRYPTION=ssl
这是我的发送电子邮件课程:
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class confirmationEmail extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;
private $userName = null;
private $link = null;
private $isConfirmed = null;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($username,$link,$isConfirmed)
{
//
$this->userName = $username;
$this->link = $link;
$this->isConfirmed = $isConfirmed;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
info("ConfirmationEmail: link: $this->link|isConfirmed:$this->isConfirmed");
return $this->from('info@test.com','test name')->subject("test title")->view('email_templates.Confirmation')->with(['name'=>$this->userName,'link'=>$this->link, 'isConfirmed'=>$this->isConfirmed]);
}
}
我认为可以通过在电子邮件中添加一些标题来解决。但我不知道我该怎么做。
解决方案
推荐阅读
- groovy - 如何将变量限制为特定的允许值?
- python - Python在两个引号之间查找特定单词前面的行
- teamcity - 如何使用两个 % 符号在团队城市中配置参数值
- scala - scala如何使用val而不是var
- haskell - 在 Haskell 中执行多个命令的基本问题
- python - 为什么比较具有相同值的两个字符串会导致错误结果?
- python - __init__ 没有 self 参数的函数定义
- javascript - 当我们在javascript中有多个具有相同ID的表单时选择表单的信息
- python - 生成几何分布时的类型错误(python 3)
- pandas - 如何将系列列表转换为两列数据框?