문제

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 = my_email@gmail.com
smtp_server = smtp.webfaction.com
error_email_from = info@mydomain.com  # this'd be a working email on webfaction

..

Please help.

도움이 되었습니까?

해결책

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 = toaddress@domain.com
mail.manager = immediate
mail.transport = smtp
mail.provider = smtp
mail.smtp.server = smtp.domain.com
mail.smtp.username = username@domain.com
mail.smtp.password = passwordhere
error_email_from = paste@localhost
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top