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

Steve Smith ssmith6@bigpond.net.au
Wed, 21 Mar 2001 23:49:30 +1100


Thanks Karthick (and all others who have contributed suggestions). Although
I don't fully understnad the syntax, I'll have a go at this tomorrow (when I
get some energy back!). But what really confuses me is why I still get the
spacey error when I hard code all of the sendmail data. And yet it looks OK
when I send it to the screen with the "pre" tag (BTW, what IS a "pre" tag?)

Phew!

Steve

-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
karthick ramanarayanan
Sent: Wednesday, March 21, 2001 11:46 PM
To: ssmith6@bigpond.net.au
Cc: zope@zope.org
Subject: [Zope] Re:Sendmail Error.It works for me.


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


_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )