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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFMail and CFScheduler

Status
Not open for further replies.

evergrean100

Technical User
Dec 1, 2006
115
0
0
US
I want to use CFScheduler tag in MX 7 to send out about 100 emails once a week at a specific time. The disctinct email addresses are taken from a query from an Access 2003 database.

Two questionns:
1- What if one or some of the 100 email addresses are not valid.
I do an data check for email validations so all the database emails have correct email syntax. But maybe there could be addresses that are not valid and the CFMail will not be able to send. Will the "dead" emails go to the Server deposit area or do anything to the other Email sends??

2- I want to make sure the CFScheduler sends at the exact time specified. Is this the correct way to do it and is the cfschedule tag 100% accurate where I can depend on it to run once a week and never run more than once a week?
Code:
<cfif DayofWeekAsString(DayOfWeek(Now())) EQ 'Friday' and Timeformat(Now(), 'hh:mm tt') EQ '12:25 PM'>
<cfschedule action = "update"
   task = "SendEmails" 
   operation = "HTTPRequest"
   url = "[URL unfurl="true"]http://myServer/mydirectory/sendEmails.cfm"[/URL]
   startDate = "5/11/07"
   startTime = "12:25 PM"
   interval = "weekly"
   path = "c:\inetpub\[URL unfurl="true"]wwwroot\mydirectory"[/URL]
   requestTimeOut = "600">
</cfif>
 
evergrean100,

To answer your first question, this is not really an issue, the best way to help ensure that dud mail accounts wont hold up the process is to loop through the query and send to each person, rather than using the 'query' attribute of the cfmail tag, this will also allow you to put slightly personal information into the mail, such as 'Hello Bob' or whatever.

Somthing like this.

Code:
<cfloop query="MyQuery">
   <cfmail blah blah blah>
   </cfmail>
</cfloop>

Next up, the ColdFusion scheduler is very accurate and stable, I used to use it ALOT for ftp type functions, and it never missed a beat with me.

However, I have a feeling you're missing somthing about the CFSCHEDULE tag, whats that CFIF for?

The scheduler function will work just fine for what you're looking to do, infact thats probably one of the core reasons Adobe put it in thier in the first place.

Let me know if you want any other questions answered.

Thanks,

Rob
 
...loop through the query and send to each person, rather than using the 'query' attribute of the cfmail tag, this will also allow you to put slightly personal information into the mail...
You can still do that if you use the query attribute of the cfmail tag. Cfmail can do everyting with the query attribute that it can do in a loop.
...in fact thats probably one of the core reasons Adobe put it in thier in the first place...
Technically, Allaire put it there almost 12 years ago when they created ColdFusion, then Macromedia bought it, and eventually sold it to Adobe. [thumbsup2] Adobe hasn't done anything to or with CF since they bought it...yet. The new release is supposed to be right around the corner (although I'm sure most of that work was done by Macromedia).

Like TamedTech, I use the ColdFusion scheduler extensively and don't have any problems with accuracy or stability. Now, that's on CFMX 6 & 7 Servers, on previous versions...not so much.


Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top