Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在laravel中发送电子邮件_Php_Laravel - Fatal编程技术网

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