4

I ran into an issue where my mail server only accepts 100 connections to the server every 5 minutes. My current code loops over my database, calling cfmail for each person on the list. I suppose the problem is im opening a new connection each time I use cfmail?

<CFLOOP QUERY="Customer" >

    <!---send mail to Admin ----->
     <cfmail to = "#cstEmail#"
      from = "#FORM.fromAddressEmail#"
      subject = "#FORM.subjectEmail#"
      server = "#var.mailserver#"
      port= "#var.mailport#"
      username="#var.mailuser#"
      password="#var.mailpass#"
      failto="#var.failEmail#
      type="html"         
       >

What I ran into was only 100 mails were being sent at a time, the rest were sent to cf's undelivered folder. I would send them to spool and again 100 would get through..

Now, I've read in older versions of cf there is a checkbox in cf administrator to "maintain connection" -Im running cf9 and dont see this option.

Would using cfmail's query attribute, force cfmail to only connect to the mail server once to send all the emails?

<cfmail query="Customer"
from = "#FORM.fromAddressEmail#"
to = "#cstEmail#"
subject = "#FORM.subjectEmail#">

Im not even sure how to test this without sending a couple hundred emails. Any thoughts if this is a viable solution to the problem?

Thanks for your help! Biscotti

BiScotti
  • 63
  • 6

2 Answers2

1

I ended up compromising by using a scheduled task to move the files every 5 minutes back over to the Spool dir from the Undelivr dir. Im not thrilled with this solution, but it works.

Thanks to Russ's Respooler extension. http://cfrespooler.riaforge.org/

BiScotti
  • 63
  • 6
  • Another problem with this solution, is that when the spooler bottlenecks at the mail server-it takes about an hour for all the mail to get through - AND I cannot send other email through this server during that time! – BiScotti Dec 09 '12 at 19:15
0

By using the above code to call the QUERY within CFMAIL I only succeeded in speeding up the client side process. The mail server still rejected the mail after the 100th connection - leading me to determine there is no server side benefit to this method over simply looping CFMAIL like in my first example. I seems the only answer is to run the code within the enterprise edition of the cf environment, one that has the "maintain connection" feature enabled.

BiScotti
  • 63
  • 6