[issue6327] [mimetext] long lines get cut with exclamation mark and newline

Jeff Hull report at bugs.python.org
Wed Nov 17 16:32:05 CET 2010


Jeff Hull <jsh2134 at gmail.com> added the comment:

I also have this problem with text getting replaced with the exclamation point.

I am using this class.
from email.MIMEText import MIMEText

Perhaps it didn't work for you because you didn't send it via email. 

try this code

	msgAlternative = MIMEMultipart('alternative')
	msgText = MIMEText(text, 'html')
	msgAlternative.attach(msgText)
	msg.attach(msgAlternative)	

	mailServer = smtplib.SMTP()
	mailServer.connect(serverURL)
	mailServer.login(user, pass)
	mailServer.sendmail(sender,to, msg.as_string())
	mailServer.quit()

----------
nosy: +Jeff.Hull

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6327>
_______________________________________


More information about the Python-bugs-list mailing list