|
|
@@ -171,11 +171,11 @@ class EMail: |
|
|
|
|
|
|
|
if not self.sender: |
|
|
|
self.sender = webnotes.conn.get_value('Email Settings', None, |
|
|
|
'auto_email_id') or getattr(conf, 'auto_email_id', None) |
|
|
|
'auto_email_id') or conf.get('auto_email_id') or None |
|
|
|
if not self.sender: |
|
|
|
webnotes.msgprint("""Please specify 'Auto Email Id' \ |
|
|
|
in Setup > Email Settings""") |
|
|
|
if not hasattr(conf, "expires_on"): |
|
|
|
if not "expires_on" in conf: |
|
|
|
webnotes.msgprint("""Alternatively, \ |
|
|
|
you can also specify 'auto_email_id' in conf.py""") |
|
|
|
raise webnotes.ValidationError |
|
|
@@ -205,7 +205,7 @@ class EMail: |
|
|
|
|
|
|
|
def send(self, as_bulk=False): |
|
|
|
"""send the message or add it to Outbox Email""" |
|
|
|
if webnotes.mute_emails or getattr(conf, "mute_emails", False): |
|
|
|
if webnotes.mute_emails or conf.get("mute_emails") or False: |
|
|
|
webnotes.msgprint("Emails are muted") |
|
|
|
return |
|
|
|
|
|
|
@@ -254,11 +254,11 @@ class SMTPServer: |
|
|
|
self.password = es.mail_password |
|
|
|
self.always_use_login_id_as_sender = es.always_use_login_id_as_sender |
|
|
|
else: |
|
|
|
self.server = getattr(conf, "mail_server", "") |
|
|
|
self.port = getattr(conf, "mail_port", None) |
|
|
|
self.use_ssl = cint(getattr(conf, "use_ssl", 0)) |
|
|
|
self.login = getattr(conf, "mail_login", "") |
|
|
|
self.password = getattr(conf, "mail_password", "") |
|
|
|
self.server = conf.get("mail_server") or "" |
|
|
|
self.port = conf.get("mail_port") or None |
|
|
|
self.use_ssl = cint(conf.get("use_ssl") or 0) |
|
|
|
self.login = conf.get("mail_login") or "" |
|
|
|
self.password = conf.get("mail_password") or "" |
|
|
|
|
|
|
|
@property |
|
|
|
def sess(self): |
|
|
|