http://net.tutsplus.com/tutorials/php/managing-cron-jobs-with-php-2/
I have downloaded the code from this site. How can i use Cron job to send mail? I am using WIndows XP.Please help me. I am new to PHP.
http://net.tutsplus.com/tutorials/php/managing-cron-jobs-with-php-2/
I have downloaded the code from this site. How can i use Cron job to send mail? I am using WIndows XP.Please help me. I am new to PHP.
cron is the time-based job scheduler in Unix-like computer operating systems. cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates. It is commonly used to automate system maintenance or administration, though its general-purpose nature means that it can be used for other purposes, such as connecting to the Internet and downloading email.
See this post how to send emails via cron job usng php mysql
Cron is a utility that runs commands on a schedule. It comes as standard with most UNIX and UNIX-like systems, but not with Windows.
You can get cron for windows or use scheduled tasks instead.
Set it up as a Windows Scheduled task, not a cron job.
You can run PHP from the command line like:
C:\PHP5\php.exe -f "C:\PHP Scripts\script.php"
Edit: The link you have supplied is a PHP tool to manage cron jobs. You would need to install a windows version of cron which one of the other answers points out. If you just want to run a task on a regular basis, use the windows scheduler to do it.
1)To create the batch file
Open Notepad.
Paste the line
"C:\xampp\php\php.exe" "C:\xampp\htdocs\test\mail.php"
Click "File" -> "Save As"
Ensure "Save as type:" is set to "All Files"
Save the file as "cron.bat" to your C drive
/Note:test is a Folder name/
2)To schedule the batch file to run
Open Command Prompt
Paste the following SchTasks /Create /SC DAILY /TN “My Task” /TR “C:cron.bat” /ST 09:00
Press Enter
This will make the script run 9 AM ever day.
Note:Try this link for more info http://www.howtogeek.com/51236/how-to-create-modify-and-delete-scheduled-tasks-from-the-command-line/
3)mail.php
<?php
$to = "test@yourmailid.com";
$subject = "Test mail PHP";
$message = "This to Inform You that Mr.name";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=UTF-8\n";
$headers .= "From: yourmailid.com <info@example.com>\n";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>