邮件未发送yahoo小型企业

时间:2018-11-06 09:23:34

标签: php laravel laravel-5 phpmailer yahoo

我正在尝试通过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');
    });
}

1 个答案:

答案 0 :(得分:0)

尝试将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);
});
相关问题