【问题标题】:Confirmation email not sent FOSUserBundle Symfony未发送确认电子邮件 FOSUserBundle Symfony
【发布时间】:2014-04-30 09:07:20
【问题描述】:

我刚刚安装了 FOSUserbundle,我想启用电子邮件确认。这意味着如果有人注册,用户应该会收到一封带有激活链接的电子邮件。

这里是 config.yml 文件:

fos_user:
db_driver:     orm
firewall_name: main
user_class: Project\UserBundle\Entity\User
service:
    mailer: fos_user.mailer.twig_swift
group:
    group_class: Project\UserBundle\Entity\Group
profile:
    form:
        type: project_user_profile
registration:
    form:
        type: project_user_registration
    confirmation:
        enabled: true
        #template: FOSUserBundle:Registration:email.txt.twig
        from_email:
            address:     zairi.ibrahim@gmail.com
            sender_name: Simlinx User Registration

还有

# Swiftmailer Configuration
swiftmailer:
transport: %mailer_transport%
encryption: %mailer_encryption%
host:      %mailer_host%
username:  %mailer_user%
password:  %mailer_password%
spool:     { type: memory } 

还有parameters.yml:

mailer_transport:  gmail
mailer_encryption: ssl
mailer_host:       ~
mailer_user:       zairi.ibrahim
mailer_password:   xxxxxxxxxxxx

第一次可以用,现在不行了!!

谢谢

【问题讨论】:

  • 你找到解决办法了吗我的朋友?

标签: email symfony


【解决方案1】:

我有这个配置并且为我工作。如果您的配置在第一次工作,则有可能 Gmail 阻止您的帐户使用 symfony 发送邮件。

config.yml

# Swiftmailer Configuration
swiftmailer:
    transport: %mailer_transport%
    encryption:%mailer_encryption%
    host:      %mailer_host%
    auth_mode: %mailer_auth_mode% login
    username:  %mailer_user%
    password:  %mailer_password%
    spool:     { type: memory } 

和parameters.yml:

mailer_transport:  smtp
mailer_encryption: ssl
mailer_host:       smtp.gmail.com
mailer_auth_mode:  login
mailer_user:       zairi.ibrahim@gmail.com
mailer_password:   xxxxxxxxxxxx

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-11-22
    • 1970-01-01
    • 1970-01-01
    • 2016-09-22
    • 2016-05-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-11
    相关资源
    最近更新 更多