Wiadomość napisana w dniu 2009-11-23, o godz. 17:43, przez rmschne:

> I'm using Django's email sending functions (http://
> docs.djangoproject.com/en/dev/topics/email/#topics-email) to send
> mail.
>
> I construct the simple HTML mail with a small bit of Python code which
> is based on data from a database accessed via Django and using a
> Django template to construct the html text.  I pass this text to
> Django's email functions, e.g.
>
> msg=EmailMessage(subject, html_content, from_email, [to])
> msg.content_subtype="html"
> msg.send
>
> The mail goes just fine.  In testing I'm sending mail to myself.  My
> own SpamAssassin filter is trapping the mail as "spam" !!
> ---- ----------------------
> --------------------------------------------------
> 1.7 MIME_HTML_ONLY         BODY: Message only has text/html MIME parts
> 2.8 MIME_BASE64_TEXT       RAW: Message text disguised using base64
> encoding
>
> I'm trying want to NOT send in base64 encoding so as to not attract
> this SpamAssassin.  How when constructing the text for the mail in
> Python/Django to avoid this?
>
> I have nothing but text in the email.  The html is simple.  It has a
> style sheet in the header.  The header looks like this:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>   <HTML>
>   <HEAD>
>   <TITLE>The Scottish Oil Club</TITLE>
>   <STYLE> style sheet here
>   </HEAD>


Unfortunately, in such case you have to construct the multipart/*  
message by hand. Remember that Python email package uses base64  
encoding for all but 8-byte encodings (Django is utf-8 on output  
side), so you have to encode it by yourself in latin (or just plain  
ASCII).

-- 
Artificial intelligence stands no chance against natural stupidity

Jarek Zgoda, R&D, Redefine
jarek.zg...@redefine.pl

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to