diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-02-15 15:55:35 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-02-15 15:55:35 +0100 |
commit | 5425bea512ea8ee87fb5ee34d0587936101c5d3a (patch) | |
tree | 0236c6da85e124b43b1933a82abdcf8963cec36c /scripting | |
parent | 919bd854d2257cfdbeaeb4e086f83fa8409f8e58 (diff) | |
parent | 07e314f63e3f1f3649e8ba91f36758519d585183 (diff) |
CWS-TOOLING: integrate CWS cmcfixes71
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/source/pyprov/mailmerge.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py index c8f7b6765261..f9c2f0f70b09 100644 --- a/scripting/source/pyprov/mailmerge.py +++ b/scripting/source/pyprov/mailmerge.py @@ -37,6 +37,7 @@ from email import Encoders from email.Header import Header from email.MIMEMultipart import MIMEMultipart from email.Utils import formatdate +from email.Utils import formataddr import sys, smtplib, imaplib, poplib @@ -123,8 +124,8 @@ class PyMailSMTPService(unohelper.Base, XSmtpService): bccrecipients = xMailMessage.getBccRecipients() if dbg: print >> sys.stderr, "PyMailSMPTService subject", subject - print >> sys.stderr, "PyMailSMPTService from", sendername.encode('utf-8') - print >> sys.stderr, "PyMailSMTPService from", sendermail + print >> sys.stderr, "PyMailSMPTService from", sendername.encode('utf-8'), sendermail + print >> sys.stderr, "PyMailSMTPService from", formataddr((sendername.encode('utf-8'), sendermail)) print >> sys.stderr, "PyMailSMPTService send to", recipients attachments = xMailMessage.getAttachments() @@ -149,10 +150,8 @@ class PyMailSMTPService(unohelper.Base, XSmtpService): else: msg = textmsg - hdr = Header(sendername, 'utf-8') - hdr.append('<'+sendermail+'>','us-ascii') msg['Subject'] = subject - msg['From'] = hdr + msg['From'] = formataddr((sendername.encode('utf-8'), sendermail)) msg['To'] = COMMASPACE.join(recipients) if len(ccrecipients): msg['Cc'] = COMMASPACE.join(ccrecipients) |