Hi everyone, I would like to send an email to all the users in my EasyPulbisher acl_users folder, however if the email address is wrong it breaks out of the loop. My form processor is as follows: <dtml-in "acl_users.getUserNames()"> <dtml-if "acl_users.getUser(_['sequence-item']).ec_email==None"> <dtml-else> <dtml-sendmail mailhost="EasyMailService"> To: <dtml-var "acl_users.getUser(_['sequence-item']).ec_email"> From: <dtml-var "AUTHENTICATED_USER.getUserName()">@esrf.fr Subj: <dtml-var reason> <dtml-var message> </dtml-sendmail> </dtml-if> </dtml-in> <p>Thank you!</p> <p><b>Your message to ESRF zope users was sent successfully.</b></b> I have tried putting a <dtml-try> and <dtml-except> in the code but nonetheless the loop breaks and only the users up to the user where the error occurs gets my mail. Any ideas anyone? How do I trap the errors raised by the sendmail tag? TIA Marie Robichon Web Task Force European Synchrotron Radiation Facility BP 220 38043 Grenoble Cedex France http://www.esrf.fr Tel: (33) 04 76 88 21 86 Fax: (33) 04 76 88 24 27
Marie Robichon wrote:
Any ideas anyone?
Well, since it seems like you send the same email to all teh recipients, it's easier to make a list of the users and send one mail to that list, instead of one mail per user. If you don't want the users to see the other recipients, use bcc. It should be easy to create a list of recipients with a Python script. I haven't use dtml-try much, but if it doesn't work and you need to send a differnt mail to each recipient, you might try to send the mail from inside a python script instead, try/except should definitely work there. :)
participants (2)
-
Lennart Regebro -
Marie Robichon