diff --git a/base_usability/models/ir_mail_server.py b/base_usability/models/ir_mail_server.py index 2e1a0ab..6927354 100644 --- a/base_usability/models/ir_mail_server.py +++ b/base_usability/models/ir_mail_server.py @@ -17,18 +17,20 @@ class IrMailServer(models.Model): smtp_user=None, smtp_password=None, smtp_encryption=None, smtp_ssl_certificate=None, smtp_ssl_private_key=None, smtp_debug=False, smtp_session=None): - # _prepare_email_message() will remove the Bcc field in message - # that's why we need to save it and re-inject it in message + # Start copy from native method if not smtp_session: smtp_session = self.connect( smtp_server, smtp_port, smtp_user, smtp_password, smtp_encryption, smtp_from=message['From'], ssl_certificate=smtp_ssl_certificate, ssl_private_key=smtp_ssl_private_key, smtp_debug=smtp_debug, mail_server_id=mail_server_id) + # _prepare_email_message() will remove the Bcc field in message + # that's why we need to save it and re-inject it in message email_bcc = message['Bcc'] smtp_from, smtp_to_list, message = self._prepare_email_message( message, smtp_session) message['Bcc'] = email_bcc + # End copy from native method logger.info( "Sending email from '%s' to '%s' Cc '%s' Bcc '%s' " "with subject '%s'. smtp_to_list=%s",