We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,687 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Email Scheduler of PHP Files

Operating System: Windows 2003 Server
Using XAMPP
Now , I have to develop a Scheduler for these reports, For Example I have 3 Reports.
These reports are PHP Files

Report1.php
Report2.php
Report3.php

I want to send them(Execute them) automatically as follows

Report1.php on Monday 9AM
Report2.php on Friday 9AM
And Report 3 on Saturday 12PM.

Do you have any Idea?

3
Contributors
14
Replies
1 Year
Discussion Span
7 Months Ago
Last Updated
16
Views
Question
Answered
ayesha789
Posting Pro in Training
496 posts since Jun 2009
Reputation Points: 17
Solved Threads: 7
Skill Endorsements: 5

if you have access to windows server.
You can create schedule task.
Accessories->system tools->schedule task
create new task
When it ask for application.
1) browse to php folder and select php.exe
2) then give space and give full path of report1.php
3) set time

repeat 1-3 steps for other reports.

urtrivedi
Posting Virtuoso
1,714 posts since Dec 2008
Reputation Points: 299
Solved Threads: 362
Skill Endorsements: 24

Is there any cron for windows??? Cron jobs are also used but I do not know much about them.

Here is tutorial of cron which I can't understand

http://net.tutsplus.com/tutorials/other/scheduling-tasks-with-cron-jobs/
ayesha789
Posting Pro in Training
496 posts since Jun 2009
Reputation Points: 17
Solved Threads: 7
Skill Endorsements: 5

if you have access to windows server.
You can create schedule task.
Accessories->system tools->schedule task
create new task
When it ask for application.
1) browse to php folder and select php.exe
2) then give space and give full path of report1.php
3) set time

repeat 1-3 steps for other reports.

I am using XAMPP and there is no PHP.EXE , from where I can found it?

ayesha789
Posting Pro in Training
496 posts since Jun 2009
Reputation Points: 17
Solved Threads: 7
Skill Endorsements: 5

Also I have another problem, as I am using PHP Mailer , I want to ADD CC address but

http://phpmailer.worxware.com/index.php?pg=methods

The above link I want to add cc

AddCC($address, $name = "")

But it requires

Adds a "Cc" address. Note: this function works with the SMTP mailer on win32, not with the "mail" mailer.
ayesha789
Posting Pro in Training
496 posts since Jun 2009
Reputation Points: 17
Solved Threads: 7
Skill Endorsements: 5

I am not sure about the ADD CC Function. Because I directly send mail, means I do not use class.

Now about automation of mail
So I explained in my post that on widows server, You can add scedule task.
Search microsoft site for details.

Cron are genrally utility for linux server cron (linux), schedule task (windows).
Cron commands will not work on windows.

Now you use file search facility of windows. in xamapp folder there might be php folder where you can find php.exe, locate php exe in your computer, I am sure you will find it.

urtrivedi
Posting Virtuoso
1,714 posts since Dec 2008
Reputation Points: 299
Solved Threads: 362
Skill Endorsements: 24

For cc on your own you may try

$mail->addCustomHeader("Cc: {$yourccmailid1},{$yourccmailid2}");

urtrivedi
Posting Virtuoso
1,714 posts since Dec 2008
Reputation Points: 299
Solved Threads: 362
Skill Endorsements: 24

if you have access to windows server.
You can create schedule task.
Accessories->system tools->schedule task
create new task
When it ask for application.
1) browse to php folder and select php.exe
2) then give space and give full path of report1.php
3) set time

repeat 1-3 steps for other reports.

Please check its giving error

Attachments error.jpg 39.29KB
ayesha789
Posting Pro in Training
496 posts since Jun 2009
Reputation Points: 17
Solved Threads: 7
Skill Endorsements: 5

give whole path of your script

php c:\mywebroot\myfolder\myreport\report1.php

urtrivedi
Posting Virtuoso
1,714 posts since Dec 2008
Reputation Points: 299
Solved Threads: 362
Skill Endorsements: 24

For cc on your own you may try

$mail->addCustomHeader("Cc: {$yourccmailid1},{$yourccmailid2}");

I try this , it worked , but cc person not get the email... :(

ayesha789
Posting Pro in Training
496 posts since Jun 2009
Reputation Points: 17
Solved Threads: 7
Skill Endorsements: 5

Kindly try on phpmailer forum, I am not sure about the error.

urtrivedi
Posting Virtuoso
1,714 posts since Dec 2008
Reputation Points: 299
Solved Threads: 362
Skill Endorsements: 24

give whole path of your script

php c:\mywebroot\myfolder\myreport\report1.php

it give error

Attachments Error-new.png 110.06KB
ayesha789
Posting Pro in Training
496 posts since Jun 2009
Reputation Points: 17
Solved Threads: 7
Skill Endorsements: 5

you continue with
php only, do not give any parameter,

then completing creating task, right cick on it and open properties

you will find RUN BOX "C:\Program Files\PHP\php.exe"

CHANGE IT TO (give appropriate path)

"C:\Program Files\PHP\php.exe" "C:\WEBROOT\YOURFOLDER\YOURREPORT\report1.php"

urtrivedi
Posting Virtuoso
1,714 posts since Dec 2008
Reputation Points: 299
Solved Threads: 362
Skill Endorsements: 24

you continue with
php only, do not give any parameter,

then completing creating task, right cick on it and open properties

you will find RUN BOX "C:\Program Files\PHP\php.exe"

CHANGE IT TO (give appropriate path)

"C:\Program Files\PHP\php.exe" "C:\WEBROOT\YOURFOLDER\YOURREPORT\report1.php"

Thanks , You solved my problem

Attachments Error-new.png 69.51KB
ayesha789
Posting Pro in Training
496 posts since Jun 2009
Reputation Points: 17
Solved Threads: 7
Skill Endorsements: 5
Question Answered as of 2 Years Ago by urtrivedi
sahiljariwala
Newbie Poster
1 post since Oct 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.1097 seconds using 2.74MB