Reputation: 723
When configuring OMS you can specify, whether it's a debugging server or not. I marked it as one, but I couldn't find any information about that mark. I can check it manually and do not send emails when I'm on debugging server...
mail_values = template.with_context(context).generate_email(self.id)
mail = self.env['mail.mail'].create(mail_values)
IrMailServer = self.env['ir.mail_server'].search([], order='sequence desc')[0]
if not IrMailServer.smtp_debug:
mail.send()
But is there any better possibility to do so? Or maybe it's already implemented somewhere, and I couldn't find it?
Upvotes: 1
Views: 696
Reputation: 14768
This flag is used for showing more debugging information in the Odoo logfile. Your Odoo server has to be configured with log level "debug" to show these information.
With this conditions you will see the SMT protocol (SMTP) messages in your Odoo log, which makes it much easier to find out about problems sending emails from Odoo.
It's not a test mode! You will really send emails with this settings.
Upvotes: 2