我有拥有自己的电子邮件地址的vps,我想测试在我的laravel API中从该电子邮件地址发送电子邮件。我通过邮递员将邮件发送到我本地机器(宅基地)上的服务器,我没有收到任何错误用户在数据库中注册但我没有收到电子邮件。有没有办法在本地计算机上配置它,但能够从现有电子邮件发送电子邮件?
我正在使用Laravel 5.4
来自authController的邮件功能
Mail::send('email.verify', ['name' => $name, 'verification_code' => $verification_code],
function ($mail) use ($email, $name, $subject) {
$mail->from('my@mailexample.pl', 'Wiadomość od CompanyName');
$mail->to($email, $name);
$mail->subject($subject);
});
配置/ mail.php
return [
'driver' => 'mail',
'host' => 'mail.mailexample.pl',
'port' => 587,
'from' => [
'address' => 'my@mailexample.pl',
'name' => 'Company Name',
],
'encryption' => '',
'username' => 'my@mailexample.pl',
'password' => '',
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];