• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Weed out email returns

Explorer ,
Sep 25, 2006 Sep 25, 2006

Copy link to clipboard

Copied

I'm managing an email list with out 14,000 active users. It's an online weekly contest that runs with CF. Twice a week we send out an email to all the users using CFMAIL. It actually works, but usually about 2000 or so get returned since they are no longer valid emails. Is there any way to have CF look through all those email returns and automatically de-activate them from our database? Thanks! We use Microsoft SQL Server.

PS. I've used a custom tag to make sure all the emails are syntactically correct. The returns are all just bad email addresses.
TOPICS
Advanced techniques

Views

547

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Sep 25, 2006 Sep 25, 2006

Copy link to clipboard

Copied

You can read and parse the mail.log file.

Or if you are willing to turn off he spooler then you can wrap the cfmail call in a try-catch like so (Paul H's code):

<cftry>
<!--- send your mail, don't forget to turn OFF spooling if you want this to work--->
<cfcatch type="Any">
<cfif cfcatch.detail contains "javax.mail.SendFailedException">
<cfset invalidAddresses="">
<cfloop index="i" from="1" to="#arrayLen(cfcatch.rootCause.InvalidAddresses)#">
<cfset invalidAddresses=listAppend(invalidAddresses,cfcat ch.rootCause.InvalidAddresses .toString())>
</cfloop>
</cfif>
</cfcatch>
</cftry>

<cfdump var="#InvalidAddresses#">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 26, 2006 Sep 26, 2006

Copy link to clipboard

Copied

Thanks for the tip! Unfortunately, I can't turn off the spooler as I'm on a shared server. How would I go about parsing the mail.log file?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Sep 26, 2006 Sep 26, 2006

Copy link to clipboard

Copied

LATEST
The cfpop suggestion is good if you don't mind wading through all the spam you will eventually get.

Attached is sample code to parse the log file.

Please note that it is highly dependent on your mail server settings to report errors.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 26, 2006 Sep 26, 2006

Copy link to clipboard

Copied

Another possiblity is to have a dedicated "from" address that will receive the bounce backs then use cfpop to check that mailbox and search the message for various possible strings like 'email address invalid' or 'address not found' and remove them from your mailing list.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation