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
\n";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>