[Zope] Re: Conditional dtml-boundary in dtml-sendmail

Josef Meile jmeile at hotmail.com
Fri Apr 11 07:52:33 EDT 2008

> Tom Von Lahndorff wrote:
>> How is dtml more "error-prone" than python? I'd imagine that all 
>> depends on
>> who's authoring it.
> In this particular example, python's email package has a very OO 
> approach to generating emails.
Yes, that's what I hate from the dtml thing; it looks ugly :-(

> The DTML approach relies on you remembering to put in the right 
> statements for the right constituent email parts in the right places.
> It's easy to make mistakes and generate emails that won't work with most 
> clients.
> It's also harder to generate emails with the correct headers (Date, 
> Message-ID, etc) than it should be, so you're more likely to pump out 
> email that mtas consider to be spam.
Actually, I did several mistakes: first, if you include a blank line
just after finishing defining the email settings, ie: "To, From,
Content-Type, etc, you will get your email, but in a format that you
can't read.

The second problem was with the unicode: first I got the characters
wrong on the email subject, but on the mail's body were ok, then I
change something and got them good on the subject, but on the
body non-ascii characters were dropped. After lots of testing, I
finally saw that you have to define content-type everywhere: on the
mail headers and also on the text-mime contents. Then you have to
encode all your strings to utf-8.

> The DTML approach also makes attaching files a living hell...
Yep, I agree on this. You can't dynamically set the number of
attachments and even if you don't submit a file on your form, zope
will send an empty file with a strange name.

Well, I guess I will do an external method on my own server and then try
to convince the people owning the machine where the page is hosted to
include it. Otherwise, my last resouce would be to embebbed the content
on a iframe or call an external link to my server.

Thanks anyways for your replies.

Best regards

More information about the Zope mailing list