This is the only solution that worked for me when their are tons of email.
Actually its not my solution, it was Tony Aly's solution and it works great.

<!---  First we pull the specific addressees--->
 <cfquery name="get_email_addresses" datasource="#attributes.dsn#"
dbserver="#attributes.dbserver#" dbname="#attributes.dbname#"
username="#attributes.dbusername#" password="#attributes.dbpassword#">
THIS QUERY RETURNS THE PEOPLE YOU ARE SENDING TO
 </cfquery>

<!---  Then we use CFX_WAIT to pause between ever iteration of sending it
out --->
<cfloop query="get_email_addresses">
<cfset current_email = trim(lcase(email))>
<cftry>
     <cfmail to="#trim(current_email)#"
from="#trim(get_email_message.from_vc)#"
subject="#trim(get_email_message.subject_vc)#"
server="#trim(attributes.mail_server)#">#get_email_message.message_mem#
     .
     </cfmail>
     <CFX_Wait Sleeptime="1">
    <cfcatch>
     <CFX_Wait Sleeptime="10">
    </cfcatch>
   </cftry>
</cfloop>

Over the last 2 years we have tried everything imaginable in CF to
accomplish the same task and this is the only solution that has worked for
us.

You can get CFX_WAIT int the tag gallery in Allaire's Developer Exchange.
http://devex.allaire.com/developer/gallery/SearchResults.cfm?keywords=CFX_WA
IT&search=search

Hope that helps,

Sean Renet
----- Original Message -----
From: "DE Bonis, Nicolas" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Sunday, April 29, 2001 10:52 PM
Subject: CFMAIL problems


>
> Hi,
>
> I am having problems with cfmail, sometimes it delivers mail and sometimes
> it doesnt.
> I performed a test in where I looped over a cfmail 20 times, and 18 of
those
> where delivered, 2 of
> them werent. Examining the mail log, the following message appeared
>
> "SMTP server replied "No connection to mail server." Moved file to
> d:\resource\apps\cfusion\MAIL\undelivr\118.cfmail."
>
> The site is hosted in australia and our mail server is in the US. I tried
> bumping the timeout up to 300 seconds and also
> specifying the mail server's address as a IP address and not a host name.
It
> still hasn't solved the problem. It is hard to find
> the problem because it occurs randomly. I have read many mailing list
> archives where this problem occurs, but they all seem
> to never be able to deliver mail, in my case, 80% of the time it does.
>
> has anyone experienced this same problem? If so, how did you fix it!
>
> Could the problem be on the mail server??
>
> Could any software on the webserver causing this. We are running
pcanywhere
> and an ftp server.
>
> Thanks in advance
>
> Nick
>
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to