INTEGRATION: CWS cmcfixes33 (1.6.8); FILE MERGED
2007/03/13 11:45:20 cmc 1.6.8.1: #i74789# better mimetype and add a proper timestamp
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
import unohelper
|
||||
import uno
|
||||
import re
|
||||
|
||||
#to implement com::sun::star::mail::XMailServiceProvider
|
||||
|
||||
@@ -36,6 +37,7 @@ from email.MIMEBase import MIMEBase
|
||||
from email.Message import Message
|
||||
from email import Encoders
|
||||
from email.MIMEMultipart import MIMEMultipart
|
||||
from email.Utils import formatdate
|
||||
|
||||
import sys, smtplib, imaplib, poplib
|
||||
|
||||
@@ -132,7 +134,8 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
|
||||
textbody = content.getTransferData(flavor)
|
||||
|
||||
textmsg = Message()
|
||||
textmsg['Content-Type'] = flavor.MimeType
|
||||
mimeEncoding = re.sub("charset=.*", "charset=UTF-8", flavor.MimeType)
|
||||
textmsg['Content-Type'] = mimeEncoding
|
||||
textmsg['MIME-Version'] = '1.0'
|
||||
textmsg.set_payload(textbody.encode('utf-8'))
|
||||
|
||||
@@ -152,6 +155,8 @@ class PyMailSMTPService(unohelper.Base, XSmtpService):
|
||||
msg['Reply-To'] = xMailMessage.ReplyToAddress
|
||||
msg['X-Mailer'] = "OpenOffice.org 2.0 via Caolan's mailmerge component"
|
||||
|
||||
msg['Date'] = formatdate(localtime=True)
|
||||
|
||||
for attachment in attachments:
|
||||
content = attachment.Data
|
||||
flavors = content.getTransferDataFlavors()
|
||||
|
Reference in New Issue
Block a user