I wrote an application in symfony 4. I deployed it on the heroku. Everything works as it should with the exception of sending emails. When I trying to send an e-mail from the console like this:
heroku run php bin/console swiftmailer:email:Send
Exception occurred while flushing email queue: Failed to authenticate on SMTP server with username "[email protected]" using 1 possible authenticat ors. Authenticator LOGIN returned Swift_TransportException: Expected response code 235 Please log in via your web browser and then try again. Learn more at https://support.google.com/mail/answer/78754 i65sm11848023qkh.49 - gsmtp " in /app/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:457
This is my swiftmailer.yaml file:
swiftmailer:
transport: gmail
username: username
password: ********
host: localhost
port: 465
encryption: ssl
auth-mode: login
spool: { type: 'memory' }
stream_options:
ssl:
allow_self_signed: true
verify_peer: false
verify_peer_name: false
How to fix this error?
smtp
you need to use astransport
? – Pouette