Skip navigation
Currently Being Moderated

CFmail errors- how to prevent error message from user?

Dec 20, 2011 11:06 AM

Greetings

 

I have an app in which the admin user sends notices to Vendors who have signed up to recieve emails when a new bid is posted.

 

Even though I have "required="yes" validate="email"" at intial Vendor sign up (I think email validation is better served using Javascript, I've heard anyway) inevitably, contact emails go bad- and there are about 5000 vendors in the system.

 

When a user (admin) sends the notices, if there is a mal-formed or dead email address in the DB, it dislays my default error screen even though the send transaction was successful.

 

Any advice on how to prevent this?

 

Thanks in advance for your help

 

sakonnetweb

 
Replies
  • Currently Being Moderated
    Dec 20, 2011 12:06 PM   in reply to sakonnetweb

    In your cfmail tag, put a special email address in the FailTo attribute.  Then see what mail that address gets after each mailing and update your db accordingly.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 20, 2011 1:27 PM   in reply to sakonnetweb

    As well as Dan's suggestion.

     

    You can use the <cftry><cfctach> syntax to provide specific error handling to specific exceptions generated by specifc code.

     

    I.E. you could wrap the <cfmail...> tag with a <cftry>...</cftry> block and then create a specific <cfcatch...> block that handles the bad email address exception any way you desire.  As Dan sugested I would sugest somehow collecting the bad email address and providing them to somebody that can clean them from the data.

     

    You could than also have a defalult <cfcatch...> block that would handle any other type of exception and|or rethrow the exception out to your current exception handler.

     

    Some people don't like the concept of try|catch syntax, but I like it and feel it is a pretty elegant solution for this type of thing.

     
    |
    Mark as:
  • Currently Being Moderated
    Dec 21, 2011 2:35 PM   in reply to sakonnetweb

    I'm missing something here.  If you have an email address in the correct format, you don't know if it's valid or not until you send mail to it.  If it's valid, nothing happens.  Otherwise, there is an Undeliverable mail reply.

     

    On the ColdFusion side, all the cfmail tag does it generate a file and put it in the Spool folder. 

     

    So my question is, what is causing your error page to run? 

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points