summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-02-15 15:55:35 +0100
committerVladimir Glazunov <vg@openoffice.org>2010-02-15 15:55:35 +0100
commit23bddc558dda9017f6c0b3b62d99e70c2b88341c (patch)
tree6cf384d56f48714c852db981ce49de7b68a38d24 /scripting
parent4c5ed8017b3d4235b75e9998b4892c65dd352efa (diff)
parentea49267fb78123e468f9468fdaa3c988c1fde8ea (diff)
CWS-TOOLING: integrate CWS cmcfixes71
Diffstat (limited to 'scripting')
-rw-r--r--scripting/source/pyprov/mailmerge.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/scripting/source/pyprov/mailmerge.py b/scripting/source/pyprov/mailmerge.py
index c8f7b67652..f9c2f0f70b 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)