【问题标题】:mail is not sending yahoo small business邮件不发送雅虎小型企业
【发布时间】:2018-11-06 09:23:34
【问题描述】:

我正在尝试通过 yahoo small business 使用 Laravel 发送电子邮件,但我收到此错误,请帮助我。

This is what I am getting an error(Image link)

My .env file

MAIL_DRIVER=smtp

MAIL_HOST=smtp.bizmail.yahoo.com

MAIL_PORT=465

MAIL_USERNAME=****@yahoo.com

MAIL_PASSWORD=*******

MAIL_ENCRYPTION=null

My Send email Code

public function index()
{
    $this->sendMail('mails.subscribe', '******@****.**', '******@**.**', 
    'Testing', 'Test');
}

public function sendMail($bladeName, $from, $to, $subject, $body)
    {
        Mail::send(['html' => $bladeName], ['user' => $body], function 
        ($message) use ($to, $subject, $from) {
        $message->to($to)->subject($subject);
        $message->from($from, 'Test');
    });
}

【问题讨论】:

  • 将您的代码发布为文本
  • 你能发布你的邮件类代码
  • 更新了 .env 文件和控制器代码

标签: php laravel laravel-5 phpmailer yahoo


【解决方案1】:

尝试将smtp端口改为:587

对不起,我忽略了您的代码。

您的邮件功能错误,这就是您无法连接的原因

尝试:

    Mail::send('emails.welcome', ['key' => 'value'], function($message)
{
    $message->to('foo@example.com', 'John Smith')->subject('Welcome!');
});

还有一个:

 Mail::send('emails.welcome', $data, function($message)

{
    $message->from('us@example.com', 'Laravel');

$message->to('foo@example.com')->cc('bar@example.com');

$message->attach($pathToFile);
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-08-20
    • 2013-01-31
    • 2023-02-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-08
    相关资源
    最近更新 更多