I have notice some users (like me) need for 'text/html' mime-type in
sendmail (and send_mass_mail, of course), some tickets treats this
subject.
I solved this problem, replacing the following line (78) in
django.core.mail module:
msg = SafeMIMEText(message, 'plain', settings.DEFAULT_CHARSET)
by this (using a new setting, called DEFAULT_EMAIL_MIMETYPE:
mime_type = settings.DEFAULT_EMAIL_MIMETYPE or 'plain'
msg = SafeMIMEText(message, mime_type, settings.DEFAULT_CHARSET)
I notice that the not yet official version, in SVN, haves a new
paradigm, through the class EmailMessage, by the method message(self),
but there is the same problem.
What do you think about my solution?
--
José Mário, Mário ou Marinho
http://del.icio.us/marinho
http://www.flickr.com/photos/marinho/
http://marinho.wordpress.com
This is the subject of ticket #3605; it has been discussed a few
times, but there has been some argument as to whether this should be
included. Search the archives for the discussions.
Yours,
Russ Magee %-)
I started ploughing through all the email tickets a while back and then
switched to unicode work, but I should get back to them. I got about
halfway through all of them, from memory.
Reading the notes I made about the earlier discussions, there was no
strong consensus on this item and I was going to add easier support for
multipart messages and then close #3605 because that would provide a way
to send HTML email whilst also encouraging best practice (including a
plain text version).
Anybody who doesn't want that exact behaviour will, of course, still be
able to send their email using Python's direct support or by overriding
the EmailMessage class. Gary Wilson's work to make the mail support more
object-oriented really helps cases like that: we avoid having to cater
to every use-case by making ourselves more extensible.
Regards,
Malcolm