I am having trouble sending mail with xampp localhost using gmail. And after a long time, I finally succeeded. And I share it with all of you. If I am wrong, this requires the right solution.
in config.yml of your symfony 2 write those
swiftmailer:
disable_delivery: false
transport: %mailer_transport%
host: %mailer_host%
username: %mailer_user%
password: %mailer_password%
port: %mailer_port%
encryption: %mailer_encryption%
In your .yml options
mailer_transport: smtp
mailer_host: smtp.gmail.com
mailer_user: gmail_user_id_without_@gmail.com
mailer_password: Your_gmail_pass
mailer_port: 465 or 587
mailer_encryption: ssl
source
share