Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Cfmail bad email error

Posted on 2009-04-23
10
Medium Priority
?
338 Views
Last Modified: 2013-12-24
Is
<cfloop>
<cfmail>
</cfmail>
</cfloop>
the best why to avoid an error with <cfmail> when it gets a bad email
0
Comment
Question by:overcolor
  • 5
  • 3
  • 2
10 Comments
 
LVL 19

Expert Comment

by:erikTsomik
ID: 24218873
is to use <cftry><cfcatch>
0
 
LVL 36

Accepted Solution

by:
SidFishes earned 2000 total points
ID: 24218977
0
 

Author Comment

by:overcolor
ID: 24219175
I like Bens post. I just wanted to build a code that even if there is a bad email it will pass it and keep processing the rest
0
[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
LVL 19

Expert Comment

by:erikTsomik
ID: 24219288
However, it will not help you if the email address is invalid
0
 
LVL 19

Expert Comment

by:erikTsomik
ID: 24219289
is Invalid i meant does not exist
0
 
LVL 36

Expert Comment

by:SidFishes
ID: 24219346
to not send a malformed email something like this should work



<cfloop query = "emails"....>
<cfif REFind("^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$", emails.email)>
<cfmail...>
<cfelse>
skip
</cfif>
</cfloop>
0
 
LVL 19

Expert Comment

by:erikTsomik
ID: 24219364
what if the email does not exist it may give an error that why you better of having <cftry><cfcatch
0
 

Author Comment

by:overcolor
ID: 24219382
erikTsomik I just dont want cfmail to error out, i dont care if the email really exist. I understand that sometimes people cancel there email accounts
0
 
LVL 19

Expert Comment

by:erikTsomik
ID: 24219406
I see
0
 

Author Comment

by:overcolor
ID: 24220234
 I got it, I use this code to find the bad emails then deleted them. Then ill use my loop to send

   <cfquery name="getlist" datasource="#dns3#">
SELECT id, email
FROM _information
ORDER BY email ASC
              </cfquery>
                 
                 
                <cfoutput query="getlist">
                  <cfset address = "#email#">
                  <cfif isValid("email", address) eq False>
                    #email#<br>
                  </cfif>
                </cfoutput>
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question