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

I created this code to notify users

Status
Not open for further replies.

NEL3644

Technical User
Sep 4, 2000
26
US
I created this code to notify users 1 week prior to expiration date...The query goes to the "Dates" TABLE and get the dates (field name: StartDate) and also goes to the "Program" TABLE to get the e-mail list (field name: EMail) of everybody whose dates are 1week prior to expiration date.
The problem I'm having w/ this code is that it gives me &quot;Error resolving parameter PROGRAM.EMAIL&quot; which is located in the &quot;TO:&quot; section of the <CFMAIL> tag. Will someone help me, please?


<cfset ExpirationDate = now() + 7>
<cfset ExpirationNum = DateFormat(#ExpirationDate#, &quot;yyyymmdd&quot;)>
<CFQUERY NAME=&quot;ExpirationNotice&quot; DATASOURCE=&quot;#Application.DataSource#&quot; DBTYPE=&quot;ODBC&quot;>
SELECT Dates.StartDate, Program.EMail
FROM Dates INNER JOIN Program ON Dates.ProgramID = Program.ProgramID
WHERE StartDate = #ExpirationNum# Order by StartDate
</CFQUERY>

<CFMAIL TO=&quot;#Program.EMail#&quot;
FROM=&quot;jukebox@maingo.com&quot;
SUBJECT=&quot;TEST&quot;
QUERY=&quot;ExpirationNotice&quot;>

This message is a TEST and was sent by an
automatic mailer built with CFMAIL...Please,
Disregard this e-mail...


</CFMAIL>
 
The problem is that you named the query &quot;ExpirationNotice&quot; but you're referring to a field called &quot;Program.EMail&quot;. You should be referring to &quot;ExpirationNotice.Email&quot;.

Andrew
amayer@sonic.net
 
U got AMayer, that problem is now solved! Thankx!
The next error message I get is:
&quot;unknown exception condition TagCFMail::sendMessage&quot;---and it indicates that this error comes from the position where the &quot;TO=&quot; is located..

Do I have to do anything else so that CFMAIL goes to the database, and grabs each record (each e-mail address) from the EMail field and automatically sends the same body message to everyone on this address list? If yes, please help me out w/ this one, it is extremely important!

 
The code you have should work just fine. I haven't seen that error before in all the cases where I've used CFMAIL. I would check the data contained in the email field of your program database and look for any inconsistent data. That's my suspicion.

Sorry I can't be more help!

Andrew
amayer@sonic.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top