本文介绍了使用FosUserBundle进行EmailConfirmation无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,自2天以来,我一直尝试通过symfony 3.4上的FOSUSERBUNDLE成功发送电子邮件确认.我知道这是FosUser自动执行的过程,但我无法使其正常工作.

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.

这是在我的framework.yaml

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: [email protected]
       sender_name: toFront
service:
        mailer: fos_user.mailer.twig_swift

这是在我的.env文件中

and this is in my .env file

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

我知道siwftmailer正在工作,因为自系统以来我可以向我的帐户发送电子邮件.

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

当我注册一个新用户时,fosuser生成一个令牌并将我重定向到/register/check-email,但是该用户的电子邮件中没有任何内容

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

编辑

这是我的swiftmailer conf:

this is my swiftmailer conf:

swiftmailer:
transport: smtp
host: localhost
username: [email protected]
password: password
port: 585
spool: { type: memory }

我怎么了?

预先感谢

推荐答案

    swiftmailer:
transport: smtp
host: localhost
username: [email protected]
password: password
port: 585
spool: { type: memory }

端口是587,而不是585

the port is 587 instead of 585

关注您

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

您的主机为 s6.g3tm.com ,而不是localhost

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

我不使用symfony 3.4,也不知道您使用的.env文件是什么

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: [email protected]
    password: password
    port: 587
    spool: { type: memory }

SMTP端口是:

  • 25(正常,不安全)
  • 465(SSL)
  • 587(TLS)

这篇关于使用FosUserBundle进行EmailConfirmation无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 10:41