thanks,
but if i click the above link, it sends out the mail and if i schedule it for cron jobs, it doesnt run. So I'm not sure if mail function is giving problems. Nevertheless, i have given the php code for the above script below-
PHP Code:
<?php
$ip=$_SERVER['REMOTE_ADDR'];
$from = "JobScheduler";
$to = "xxx@abc.com";
$subject = "hello test msg";
$message = "Hello test" . "\n your ip address is: $ip";
$headers = 'From: ' . $from . "\r\n" . 'Reply-To: ' . $from . "\r\n" .
'X-Mailer: PHP/' . phpversion();
// Send
if (mail($to, $subject, $message, $headers)) {
echo "-->mail sent";
echo "<b>IP Address= $ip</b>";
} else {
echo "failed";
}
?>