ColdFusion Mail Spool Timeout

429 Views Asked by At

I have a form that is sending 4 separate emails when it is processed all of which contain up to 4 attached PDF/Word documents. The way I have it setup is that I have spoolenable="false" on every email so that they are sent immediately. Then, on the last email I also have remove="true" so that the attachments are deleted from my server. The problem that I'm having is that only 2 of the 4 emails are being sent before I get a:

java.net.SocketTimeoutException: Read timed out.

Not really sure what I can do to fix this but I'm willing to try any suggestions.

Thanks

1

There are 1 best solutions below

4
On

This would be a poor use of spoolenable="false". What that setting does is set the email to send immediately bypassing the built in mail spooler. This makes the client request have to wait to return till the email is sent. This impacts the users of the system as they now have to wait for the CF server to actually send the email. This now adds a potential point of failure to the client request and could cause other issues.

If you want to avoid the spool I would do the mail send in a cfthread. This way you are at least not impacting the client with the mail send.