0

Hi to all again,

Can anyone one help me with this? The scenario goes like this.
I have this PHP script:

<?php

 $to = "email_address_here";
 $subject = "SAMPLE AUTOMATIC MAIL";
 $body = "Hi to Every one. Please help me with this ^^,";	

 if (mail($to, $subject, $body))
 {
      echo("<p>Message successfully sent!</p>");
      echo "Sent to: $to";
 }

?>

Above code works fine. When I type the "http://server/folder/phpfile.php" at my explorer address bar, the message was successfully sent.

I try to use windows schedule task to run this automatically, but it only open the phpfile.php itself. By the way, my I'm using Windows Server 2003 OS.

Note: I don't want to use cron for this activity.

Thanks in advance guys.

2
Contributors
3
Replies
10
Views
6 Years
Discussion Span
Last Post by lyrico
0

You need to use the php.exe to execute the file. So in your scheduler you'd add something like this:

c:\PHP\php.exe -f "c:\Apache\htdocs\folder\phpfile.php"
0

Is there anything wrong with my task scheduler? It doesn't work

Attachments task_scheduler.JPG 27.07 KB
0

This issue was solve. I just have some mistake on the path of my file.
Thanks pritaeas. you solve my problem. ^^,

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.