Skip to main content
Inspiring
March 18, 2014
Answered

How to use CFschedule?

  • March 18, 2014
  • 1 reply
  • 846 views

I am trying to send an email with CFschedule... from what I can tell by looking at the documentation, I am doing it right. I am not getting any error messages but the email is not sending. The CFschedule is the action page of a form. When the form processed, it should set the CFschedule for another action page which sends the email. Here is the code -

The code that fires on a form submit (I have verified that this page is being called properly)

<cfschedule

action="update"

task ="sendemail"

startDate ="3/18/2014"

endDate ="3/18/2014"

operation = "HTTPRequest"

interval ="once"

url = "sendemail.cfm"

startTime = "10:43:00"

>

And the action page.

<cfmail

    from="xxxxx@xxx.Xxx"

    to="xxxxx@xxxx.xxx"

    subject="Your Equipment Test">

Your equipment lease is due back to CIE tomorrow.  

</cfmail>

Thanks!

This topic has been closed for replies.
Correct answer gwarmonger

It is for an inventory system. The form includes a return date for borrowing an item. When they submit the form, the cfschedule will use the return date from the form variable as the enddate attribute on the cfschedule. So...the day their equipment is due back, they recieve an email.

My code does not reflect this yet, I hardcoded a date for testing purposes.

And actually, I got it to work. I had to change the URL attribute to an absolute link instead of relative.

-sean

1 reply

Dave Ferguson
Participating Frequently
March 18, 2014

Couple questions here...

First.. Why are you using cfschedule to just send an email?  This could be more easily done in the form processor.

Second... If you are using the cfschedule to do it what happens if 2 people submit the form at the same time?

As for the email, check in the undelivered folder on the server for the email.  If it was unable to be sent it would be in there.

HTH,

--Dave

gwarmongerAuthorCorrect answer
Inspiring
March 18, 2014

It is for an inventory system. The form includes a return date for borrowing an item. When they submit the form, the cfschedule will use the return date from the form variable as the enddate attribute on the cfschedule. So...the day their equipment is due back, they recieve an email.

My code does not reflect this yet, I hardcoded a date for testing purposes.

And actually, I got it to work. I had to change the URL attribute to an absolute link instead of relative.

-sean