Reputation: 83
I just installed the FOSUserbundle and I want to have the e-mail confirmation enabled. Meaning if someone registers the user should get an email with an activation link.
Here is the config.yml file:
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: [email protected]
sender_name: Simlinx User Registration
And
# Swiftmailer Configuration
swiftmailer:
transport: %mailer_transport%
encryption: %mailer_encryption%
host: %mailer_host%
username: %mailer_user%
password: %mailer_password%
spool: { type: memory }
And parameters.yml :
mailer_transport: gmail
mailer_encryption: ssl
mailer_host: ~
mailer_user: zairi.ibrahim
mailer_password: xxxxxxxxxxxx
It works in the first time, but now it does not work anymore !!
Thnks
Upvotes: 2
Views: 2241
Reputation: 595
I have this configuration and works for me. If your configuration works in the first time, it is possible Gmail block your account to send mails with 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 }
And parameters.yml:
mailer_transport: smtp
mailer_encryption: ssl
mailer_host: smtp.gmail.com
mailer_auth_mode: login
mailer_user: [email protected]
mailer_password: xxxxxxxxxxxx
Upvotes: 0