EmailConfirmation with FosUserBundle Does not work

2019-08-20 08:08发布

问题:

hello i have been trying to send an email Confirmation since 2 days without success with FOSUSERBUNDLE on symfony 3.4. I know this is a process FosUser makes automatically But i can't make it's work.

this is in my framework.yaml

fos_user:
db_driver: orm
firewall_name: main
user_class: App\Entity\User
registration:
        confirmation:
            enabled: true
from_email:
       address: correo@algo.com
       sender_name: toFront
service:
        mailer: fos_user.mailer.twig_swift

and this is in my .env file

MAILER_URL=smtp://s6.g3tm.com?encryption=ssl&auth_mode=login&username=MYADDRESS&password=*****

i know siwftmailer is working because i can send emails to my account since the sistem.

and when i register a new user, fosuser generate a token and redirect me to /register/check-email but there is nothing in the email of such user

EDIT

this is my swiftmailer conf:

swiftmailer:
transport: smtp
host: localhost
username: correo@algo.com
password: password
port: 585
spool: { type: memory }

what am I wrong?

thanks in advance

回答1:

    swiftmailer:
transport: smtp
host: localhost
username: correo@algo.com
password: password
port: 585
spool: { type: memory }

the port is 587 instead of 585

following your

MAILER_URL=smtp://s6.g3tm.com?encryption=ssl&auth_mode=login&username=MYADDRESS&password=****

Your host as to be s6.g3tm.com not localhost

I don't use symfony 3.4, and I don't know what is the .env file you are using

With your settings, a good configuration could be:

swiftmailer:
    transport: smtp
    host: s6.g3tm.com
    username: correo@algo.com
    password: password
    port: 587
    spool: { type: memory }

SMTP ports are :

  • 25 (normal, insecure)
  • 465 (SSL)
  • 587 (TLS)