Added timing information to the send_smtp() log entries.
- Legacy-Id: 18628
This commit is contained in:
parent
e97b5e2fc4
commit
9cd45195ef
|
@ -90,6 +90,7 @@ def send_smtp(msg, bcc=None):
|
|||
If someone has set test_mode=True, then append the msg to
|
||||
the outbox.
|
||||
'''
|
||||
mark = time.time()
|
||||
add_headers(msg)
|
||||
(fname, frm) = parseaddr(msg.get('From'))
|
||||
addrlist = msg.get_all('To') + msg.get_all('Cc', [])
|
||||
|
@ -137,7 +138,8 @@ def send_smtp(msg, bcc=None):
|
|||
except smtplib.SMTPServerDisconnected:
|
||||
pass
|
||||
subj = force_text(msg.get('Subject', '[no subject]'))
|
||||
log("sent email from '%s' to %s id %s subject '%s'" % (frm, to, msg.get('Message-ID', ''), subj))
|
||||
tau = time.time() - mark
|
||||
log("sent email (%.3fs) from '%s' to %s id %s subject '%s'" % (tau, frm, to, msg.get('Message-ID', ''), subj))
|
||||
|
||||
def copy_email(msg, to, toUser=False, originalBcc=None):
|
||||
'''
|
||||
|
|
Loading…
Reference in a new issue