[Zope] MailHost, subject and Spanish characters

george donnelly list@zettai.net
Wed, 02 Jul 2003 18:34:47 +0000


I have a script that produces an email (in Spanish) when new content is
published. I can get the body of the email to show up correctly (ie the
accents etc render correctly) but the subject turns spanish characters into
garbage.

Any suggestions on where I can look for a solution?

Here is the relevant part of the script:

mMsg = "To:" + item.email + "\n"
mMsg = mMsg + "From: me@example.com\n"
mMsg = mMsg + "Mime-Version: 1.0\n"
mMsg = mMsg + "Content-Type: text/plain; charset=utf-8\n\n"
mMsg = mMsg + "FECHA: " + contentObject.Date() + "\n"
mMsg = mMsg + "FUENTE: example \n\n"
mMsg = mMsg + "RESUMEN: \n"
mMsg = mMsg + contentObject.Description() + "\n\n"
mMsg = mMsg + "TEXTO COMPLETO: " + contentObject.absolute_url() + "\n\n"
mMsg = mMsg + "Mandar este articulo a un amigo: \n"
mMsg = mMsg + contentObject.absolute_url() + "/portal_form/sendto_form\n\n"
mMsg = mMsg + "Dejar de recibir alertas:
http://example.com/portal_form/personalize_form\n\n"
mSubj = "ALERTA:" + contentObject.Title()

mailhost.send(mMsg, subject=mSubj, encode='quoted-printable')

if i set the charset to iso-8859-1 then the body is screwed up as well.

tia

<-->
george donnelly - http://www.zettai.net/ - "Quality Zope Hosting"
Zope Hosting - Dynamic Website Design - Search Engine Promotion
Yahoo, AIM: zettainet - MSN: zettainet@hotmail.com - ICQ: 51907738