Dave,

A) What is the error. Fixing the error will keep your loop going.
B) Using a try/catch INSIDE the loop will allow you to keep it going - with
the caveat that you will miss whatever email throws the error so you might
want to log that inside the catch.

-Mark


-----Original Message-----
From: Dave Long [mailto:d...@northgoods.com] 
Sent: Thursday, April 02, 2015 5:12 PM
To: cf-talk
Subject: Handling invalid recipient in mailing list


I am trying to send a mass mailing to a somewhat carelessly created list of
contacts using e-mail addresses which were not verified at the time of
entry. Whenever the cfloop tag comes to an erroneous recipient, it quits and
throws an error. Is there anything I can do to the code to make it keep
going?

Here's the code:

        <CFLOOP list="#Form.SelectedRecipients#" index="Recipient">
                <CFMAIL
                        from="#Form.Sender#"
                        to="#Recipient#"
                        subject="#Form.Subject#"
                        type="HTML"
                        >
<html><head><link rel="stylesheet"
href="http://www.northgoods.com/global.css"; type="text/css" /></head><body
bgcolor="black">
                <table width=800 align="center">
                <TR>
        <TD align="center" colspan=2>
        <table width=800 align="center" border="4" cellpadding="10"
bgcolor="black"><tr><td>
        <strong><font face="Arial" size="+1" color="##FF6600">
        #Form.Message#
        </font></strong>
        </td></tr></table>
        <table align="center">
        <tr><th colspan="2"><strong><font face="Arial" size="-1"
color="##FF6600">If you would like to be removed from<br>our mailing list,
please click here:</font></strong><br>
        <a
href="http://www.northgoods.com/unsubscribe.cfm?delEmail=#Recipient#";
title="UNSUBSCRIBE"><font face="Arial" size="-1"
color="white"><strong>UNSUBSCRIBE</strong></font></a><br>
<font face="Arial" size="-1" color="##FF6600">You will receive one last
message from us to confirm your removal from our
list.</font></strong></th></tr>
</TABLE></body></html>
                </CFMAIL>
        </CFLOOP>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360352
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to