Unable to send mail via gmail in Symfony 2.8.3 in prod on freebsd host while it works on Windows 10 with same source code in both prod & dev. [Also unable to get a log of mailing on host, which might help resolve this.]
Update: Mail can be sent using PHP's mail()
function. Using Swiftmailer to send mail from a controller does not work. Changed parameters to use mailer_transport: smtp mailer_host: localhost
does not enable Swiftmailer to send from a controller.
parameters.yml:
mailer_transport: gmail
mailer_host: smtp.gmail.com
mailer_user: {valid address}
mailer_password: (valid password}
config.yml:
swiftmailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
username: "%mailer_user%"
password: "%mailer_password%"
encryption: ssl
auth_mode: login
config_prod.yml:
monolog:
handlers:
mail:
type: fingers_crossed
action_level: critical
handler: buffered
buffered:
type: buffer
handler: swift
swift:
type: swift_mailer
from_email: "%mailer_user%"
to_email: "%mailer_user%"
subject: Error report!
level: debug