Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

codepandit's avatar

Login and Register works locally, but doesn't work after it deployed to the web

I have been trying to figure it out why is it happening? I made the generic laravel login with php artisan make:auth, it works perfectly on my local machine. I deployed my app online today, Login and register gives me an error. I google that error mostly its related to mail services but Login and Register is nothing to do with Mail. In a log file error is quite large. Here are the some lines of error error:-

production.ERROR: Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required " {"exception":"[object] (Swift_TransportException(code: 530): Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required " at /var/www/laravel/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:419) [stacktrace] #0 /var/www/laravel/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(317): Swift_Transport_AbstractSmtpTransport->assertResponseCode('530 5.7.1 Authe...', Array) #1 /var/www/laravel/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(272): Swift_Transport_AbstractSmtpTransport->executeCommand('MAIL FROM:<hell...', Array, Array) #2 /var/www/laravel/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(348): Swift_Transport_EsmtpTransport->executeCommand('MAIL FROM:<hell...', Array) #3 /var/www/laravel/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(452): Swift_Transport_EsmtpTransport->doMailFromCommand('[email protected]...') #4 /var/www/laravel/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(480): Swift_Transport_AbstractSmtpTransport->doMailTransaction(Object(Swift_Message), '[email protected]...', Array, Array) #5 /var/www/laravel/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(189): Swift_Transport_AbstractSmtpTransport->sendTo(Object(Swift_Message), '[email protected]...', Array, Array) #6 /var/www/laravel/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(73): Swift_Transport_AbstractSmtpTransport->send(Object(Swift_Message), Array) #7 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(464): Swift_Mailer->send(Object(Swift_Message), Array) #8 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(248): Illuminate\Mail\Mailer->sendSwiftMessage(Object(Swift_Message)) #9 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(148): Illuminate\Mail\Mailer->send('emails.contact', Array, Object(Closure))

0 likes
6 replies
codepandit's avatar

I am new to laravel, that is my first project learning Laravel. I'll try changing MAIL_DRIVER=log in .env and let you know if that works. Cheers!

codepandit's avatar

It didn't work, Could it be possible that my app is not communicating with sql databse?

jcphpdev's avatar

Run this command and try again:

php artisan config:cache
Robstar's avatar

Check to make sure you mail settings are correct i.e. correct port number, host, user, pass etc.

codepandit's avatar

Hi all, I think I have fixed the problem by updating the mail settings, but now I'm getting an error regarding database access, I not sure where I have to give permissions. Here is the error:-

""[2018-05-13 05:52:25] production.ERROR: SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' {"exception":"[object] (PDOException(code: 1698): SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' at /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68) [stacktrace] #0 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(68): PDO->__construct('mysql:host=loca...', 'root', 'root', Array) #1 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(44): Illuminate\Database\Connectors\Connector->createPdoConnection('mysql:host=loca...', 'root', 'root', Array) #2 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=loca...', Array, Array) #3 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(183): Illuminate\Database\Connectors\MySqlConnector->connect(Array) #4 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}() #5 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Connection.php(915): call_user_func(Object(Closure)) #6 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Connection.php(399): Illuminate\Database\Connection->getPdo() #7 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Connection.php(325): Illuminate\Database\Connection->getPdoForSelect(false) #8 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Connection.php(657): Illuminate\Database\Connection->Illuminate\Database\{closure}('select count()...', Array) #9 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('select count()...', Array, Object(Closure)) #10 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Connection.php(333): Illuminate\Database\Connection->run('select count()...', Array, Object(Closure)) #11 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1909): Illuminate\Database\Connection->select('select count()...', Array, false) #12 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(1894): Illuminate\Database\Query\Builder->runSelect() #13 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2241): Illuminate\Database\Query\Builder->get(Array) #14 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2169): Illuminate\Database\Query\Builder->aggregate('count', Array) #15 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Validation/DatabasePresenceVerifier.php(55): Illuminate\Database\Query\Builder->count() #16 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Validation/Concerns/ValidatesAttributes.php(687):""

Please or to participate in this conversation.