Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resend Emails

Status
Not open for further replies.

ibwebn65

Programmer
Sep 4, 2002
22
US
Now to the problem. I am reviewing the report from the code compatibility analyzer (cca) in order to migrate a site to CFMX. One of the items marked as an error by the cca report was the use of cfregistry.

The code identified is being used to resend emails. The cca error message indicates that CFREGISTRY should not be used on Windows servers. Is there another way to resend unsuccessful emails? Below is the error message given by the cca report along with an example of the current code being used.

CCA Error Message:
CFREGISTRY is deprecated in UNIX versions of ColdFusion MX. In Windows, you should not use CFREGISTRY to read ColdFusion server settings, because much of this information is no longer stored in the registry, or it is in a different location in the registry. The ColdFusion-related values that are stored in the registry are subject to change.

Current Code:
<!--- get the undelivr folder from the ColdFusion settings (The Registry) --->
<cfregistry action="GET" branch="HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\Mail" entry="BaseDirectory" variable="strMailPath" type="String">

<cfregistry action="GET" branch="HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\Mail" entry="BaseDirectory" variable="strMailPath" type="String">

<!--- get all the files inside that folder except for the . .. --->
<cfdirectory action="LIST" directory="#strMailPath#\undelivr" name="Undeliv">

<!--- if there are any files, move them --->
<cfif Undeliv.RecordCount GT 2>
<cfloop query="Undeliv">
<cfif Undeliv.Name is not "." and Undeliv.name is not ".." and Undeliv.Type is "File">
<cffile action="MOVE" source="#strMailPath#\undelivr\#Undeliv.Name#" destination="#strMailPath#\spool\">
</cfif>
</cfif>

 
There are several custom tags I've found that will take the mail out of the undeliverable folder and move it back to the spool folder without touching the registry. Check around on the Macromedia Exchange, that's where I found them and I think most of them are free.



Hope This Helps!

Ecobb
Beer Consumption Analyst

"My work is a game, a very serious game." - M.C. Escher
 
Thank you for your responses.

Ecobb - I looked for a custom tag that would do this, but all I found were custom tags for POP servers. I don't think they would work with my corporate exchange server.

cannedRadio - From the link you provided, it looks like the easiest thing to do is replace the code with a SET variable. This does leave things open for future errors when the directory changes with future releases of CF. For preventive measures, I'll add a lot of comments, and some code to check for the existense of the directory. If the directory ever changes, I'll set the code to display a little message to inform the developer to update the variable.

Again, thank you for your responses.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top