Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Mail to Log

Tags:

php

email

laravel

I have my Laravel Mail driver setup as to print to my log file:

'driver' => env('MAIL_DRIVER', 'log'), 

When I send mail, however, I am receiving a swiftmail authentication error:

Expected response code 250 but got code '530' with message '530 5.7.1 Authentication required'

vendor\\swiftmailer\\swiftmailer\\lib\\classes\\Swift\\Transport\\AbstractSmtpTransport.php 

line 383\">AbstractSmtpTransport.php line 383

530 5.7.1 Authentication required 

Is there another setting I need to set somewhere? Why is it trying to use swiftmailer?

like image 987
Vranvs Avatar asked Mar 14 '17 23:03

Vranvs


People also ask

How do I get Laravel logs?

By default, Laravel is configured to create a single log file for your application, and this file is stored in app/storage/logs/laravel. log .


1 Answers

This is in your mail.php config file...

When using

'driver' => env('MAIL_DRIVER', 'log'), 

This will get the MAIL_DRIVER environment variable set in your .env file. In this case, 'log' is used only as a default if a value is not specified in your .env file... Your .env file probably has this still set in it... set it to log...

MAIL_DRIVER=smtp 

replace with

MAIL_DRIVER=log 

NOTE: For laravel >= 7.x MAIL_DRIVER replaced with MAIL_MAILER variable

like image 161
Serge Avatar answered Oct 13 '22 00:10

Serge