[Zope] Re:Sendmail Error.It works for me.

karthick ramanarayanan karthick@pepco.no
Wed, 21 Mar 2001 13:46:02 +0100 (CET)


Hi,
 I have used dtml-sendmail with multiple To: addresses,fetched from the database without any problems.
After you fetch the email Object list from the data Base,
convert the object List into a list of strings and join the list with commas.Then use the dtml-sendmail tag to send the mail.
You can do this,assuming your sql_query returns a list of Emails.
Assuming that your query is called sql_get_emails,and it contains a field called email,do this,

<dtml-call "REQUEST.set('mylist',[])">
<dtml-in sql_get_emails>
<dtml-call "mylist.append(email)">
</dtml-in>
<dtml-let mailString="_.string.join(mylist,',')" >
Now use this mailString to send the mail.
I do this,after fetching mailString,

<dtml-sendmail smtphost="mail.pepco.no">
To: <dtml-var mailString>
From: <dtml-var from>
Subject: <dtml-var subject>
<dtml-var body>
</dtml-sendmail>
</dtml-let>

I hope that you dont get frustrated after this.

Bye,
A.R.K