How to pass SMTP username and password in Pylons config?

215 views Asked by At

I'd like to configure a Pylons app, so that I get email on unhandled exceptions. So far I can't find the way to pass username and password for SMTP connection.

production.ini file:

..

[DEFAULT]
email_to = [email protected]
smtp_server = smtp.webfaction.com
error_email_from = [email protected]  # this'd be a working email on webfaction

..

Please help.

1

There are 1 answers

0
jchysk On BEST ANSWER

If you want to access them in pylons.config then you want to put them in the [app:main] section of the configuration.

I've used turbomail, and then you can put them in [DEFAULT]. This is what my config looked like.

[DEFAULT]
mail.on = true
email_to = [email protected]
mail.manager = immediate
mail.transport = smtp
mail.provider = smtp
mail.smtp.server = smtp.domain.com
mail.smtp.username = [email protected]
mail.smtp.password = passwordhere
error_email_from = paste@localhost