symfony swift邮件主机名

This my parameter.yml

parameters:
database_host: localhost
database_port: null
database_name: mongodb
database_user: mongodb
database_password: *******
mailer_transport: smtp
mailer_host: //which host?
mailer_user: support@domain.com
mailer_password: *****
secret: ThisTokenIsNotSoSecretChangeIt

And this is my config.yml

swiftmailer:
transport: "%mailer_transport%"
encryption: ssl
auth_mode: login
host:      "%mailer_host%"
username:  "%mailer_user%"
password:  "%mailer_password%"
spool:     { type: memory }

I tried different hosts like ~,127.0.0.1,localhost,etc in the mailer_host: parameter. But mail is not sending.

If I use Gmail account with,

mailer_host: smtp.gmail.com

the mail is sending properly. Where am I wrong?

You probably don't have a SMTP daemon running on your machine. The daemon should then listen on an IP address or a machine hostname which you then put in the configuration.

Other thing you can do is to change the mail_transport parameter to mail or sendmail – those do not require SMTP daemon.

See How to Send an Email symfony documentation page.