Forum Moderators: coopster
<?php
$weekday = date("w");
$hour = date("H");
$minute = date("i");
$second = date("s");
echo $weekday;
echo "<br>", $hour, "<br>";
echo $minute, "<br>";
echo $second, "<br>";
$msg .= "The new paper has been uploaded. ";
$to = "somebody@somewhere.com";
$sub = "The paper for next club meeting.";
$from = "auto_noreply@some.com";
if($weekday ==2 && $hour ==12 && $minute == 00 && $second == 00){
mail($to, $sub, $msg, $from);
}
if(mail()){
echo "The mail works.";
}
else{
echo "something wrong.";
}
?>
Thanks in advance.
When done (I assume that your site runs on a *nix server)
Call your ISP and simply state that you have a cron job to run and that you have made the script that should be timely executed
Come with a schedule and that's it
Writing the cron is not a lengthy task and if they charge you it should be very affordable :)
<?php
$msg .= "The new paper has been uploaded. ";
$to = "sqlnew@someuni.edu";
$sub = "The paper for next club meeting.";
$from = "auto_noreply@some.com";
mail($to, $sub, $msg, $from);
if(mail()){
echo "Good.";
}
else{
echo "No.";
}
?>
Can you tell me whether the ISP need set up something before the mail() function run?
$to="sqlnew@someuni.edu";
$sub = "The paper for next club meeting.";
$from = "auto_noreply@some.com";
$message="The new paper has been uploaded. ";
if (@mail($to, $sub, $from, $message, $headers)) {
echo('<h3><b>Thank you, etc.</h3>');
} else
{
echo('<p>Hmmm! Slight email problem...<br>
aaaaaaaaaaaaaaaa</p>');
}
?>
Your ISP needs location of your mail script
also only the OK part of the message from the previous script had an error but the mail workedd ;
I received the emails
<?
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$to="aaaa@.com";
$subject="Save those links";
$message='Henry: New demo activated check Dir: '.$rand ;
if (@mail($to, $subject, $message, $headers)) {
echo('<h3><b>Thank you, #*$!xi.com is notified, we will help you as needed.</h3>');
} else
{
echo('<p>Hmmm! Slight email problem...<br>
Please email to site admin from our contact form (Location: Home Page) and explain what occured, thank you.</p>');
}
?>
<Edit>
OOPPSS: Read occurred not accoured :)
</edit>
Did you try it as is; just changing the email address?
regardless of the error do you get any mail?
If it does not work I hope that the cavalry will show up for I am clueless
Sorry