Reputation: 19
i'm trying to do my first symfony project and i am using the fosuserbundle. It's working perfectly i'm just having a problem with the email confirmation, i'm not receiving anything.
This is my parameters.yml:
parameters:
database_host: 127.0.0.1
database_port: null
database_name: mydatabase
database_user: root
database_password: null
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: [email protected]
mailer_password: mypass
secret: 8c73d1f9bc7f50ce500d4a98a4627ffaa42dc905
this is myconfig.yml:
swiftmailer:
transport: %mailer_transport%
host: %mailer_host%
username: %mailer_user%
password: %mailer_password%
port: "585"
spool: { type: memory }
fos_user:
db_driver: orm
firewall_name: main
user_class: OC\UserBundle\Entity\User
service:
mailer: fos_user.mailer.twig_swift
registration:
confirmation:
enabled: true
from_email:
address: [email protected]
sender_name: myname
service:
mailer: fos_user.mailer.twig_swift
please can you help? because i searched on the web and tried but since it's my first project none of the solutions are working with me.
Upvotes: 1
Views: 318
Reputation: 12012
Try with these slight changes in your config.yml
:
port: 585
auth_mod: login
The value for the port doesn't need to be enclosed in quotes. I'm not sure if this really makes a difference, but you should follow the conventions.
Since you're using smtp
as mailer_transport
you have also to specify the authentication mode. Check the documentation for more details:
http://symfony.com/doc/current/reference/configuration/swiftmailer.html
Eventually you'll need another value for the authentication mode.
EDIT (2016-02-19):
Instead of using smtp
as mailer_transport
you can use the shortcut gmail
. Please see this article from the Symfony Cookbook:
http://symfony.com/doc/current/cookbook/email/gmail.html
Then you can omit the line:
auth_mod: login
This shortcut will set the host
to smtp.gmail.com
. In your configuration you have the host set to 127.0.0.1. This could eventually be the reason why it works with the web_profiler
, but not with the real e-mail address.
Upvotes: 1