On 29 mar, 10:47, "het.oosten" <het.oos...@gmail.com> wrote: > When I send mails with my Django app the first line of every mail is: > Content-Type: text/html; charset=utf-8 > > When i watch the message source i noticed that charset=utf-8 is > changed into charset=3Dutf-8 > > I also saw that in the message header the mail is marked as: > Content-Type: text/plain; charset="utf-8" > > Why is the contect type printed in the first line of the mail? > > This is my view: > from django.core.mail import send_mail > subject = "subject" > message = render_to_response('mymail',
Look no further. render_to_response() - as the name implies - returns an HTTPResponse object - which doesn't make sense here. You just want to render the template: t = loader.get_template('mymail') c = Context({ 'Mailaddress': Mailaddress, 'Mailhash': Mailhash, }) message = t.render(c) > mymail is a text file in my template directory. html files, django template files, python source files etc are all "text files", you know ?-) HTH -- 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.