• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

13. Working with Email > 13.2. Dealing with Undeliverable Email

Dealing with Undeliverable Email

Every now and then, something goes wrong when ColdFusion attempts to send an email. Problems can range from a missing email address in the to attribute, to a problem connecting to the SMTP server. Regardless of the cause of the problem, ColdFusion deals with undeliverable email in a consistent and simple manner. All undeliverable email messages are written to temporary files with a .cfmail extension and saved to a folder on the ColdFusion server called \undelivr.[1] The \undelivr folder is usually located in \cfusionmx\mail\undelivr\.

To resend a message that has been moved to the \undelivr folder, the temporary file must be moved back to the \spool folder, which is usually located in \cfusionmx\mail\spool. This can be done manually or via ColdFusion. Obviously, using ColdFusion to monitor the \undelivr directory for undelivered mail is more convenient than manually checking the directory every time an email is generated. To do this, you need to create a template that scans the \undelivr folder and schedule it to run at set intervals. Example 13-7 contains a template you can use to scan your \undelivr folder and move any files found back to the \spool folder so that attempts can be made to resend them. Using the Scheduler within the ColdFusion Administrator, the template can be set to run at predetermined intervals.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint