Php 如何在laravel中发送电子邮件
我试过这个Php 如何在laravel中发送电子邮件,php,laravel,Php,Laravel,我试过这个 <?php return array( 'driver' => 'smtp', 'host' => 'smtp.sendgrid.net', 'port' => 587, 'from' => array('address' => 'from@example.com', 'name' => 'John Smith'), 'encryption' => 'tls', 'username' => 'sendgri
<?php
return array(
'driver' => 'smtp',
'host' => 'smtp.sendgrid.net',
'port' => 587,
'from' => array('address' => 'from@example.com', 'name' => 'John Smith'),
'encryption' => 'tls',
'username' => 'sendgrid_username',
'password' => 'sendgrid_password',
);
Mail::send('emails.demo', $data, function($message)
{
$message->to('jane@example.com', 'Jane Doe')->subject('This is a demo!');
});
如何解决这个问题
请帮助我。确保设置正确,用户名和密码正确,该功能本身应该可以像您发布的那样工作。也许可以帮助您?或者关于该错误消息的其他问题之一。现在我收到了此错误:预期响应代码250,但收到代码“535”,消息“535-5.7.8用户名和密码不被接受。在535 5.7.8 n10sm20739350pdp.18-gsmtp了解更多信息”您确定您的帐户处于活动状态并已设置吗?
Failed to authenticate on SMTP server with username "sendgrid_username" using 2 possible authenticators