0

I don't understand why swiftmailer doesn't work with gmail?

I get this exception:

 ERROR     [app] Exception occurred while flushing email queue: Connection could not be established with host smtp.gmail.com [ #0]

Here is MAILER_URL in .env file:

MAILER_URL="gmail://**********@gmail.com:Password@localhost"

===> My password contains some special characters like '@'. What i have to do in this case?? Maybe it is why it doesn't work?

Here is swiftmailer.yaml:

swiftmailer:
url: '%env(MAILER_URL)%'
spool: { type: 'memory' }

I already try to disable Avast...Clear cache...not working...

But when i try with an another smtp like 'smtp.orange.fr', everything work fine.

Any idea, please?

Moh
  • 39
  • 1
  • 11

1 Answers1

0

if the username, password or host contain any character considered special in a URI (such as +, @, $, #, /, :, *, !), you must encode them. See RFC 3986 for the full list of reserved characters or use the urlencode function to encode them.