Anyone can help me regarding this question.
There is my coding.
<?php
error_reporting(E_ALL ^ E_NOTICE);
//select all data from table 'accessories_update'
$record = mysql_query("SELECT InStock FROM accessories_update") or die(mysql_error());
//select total number of row from the previous record
$total = mysql_fetch_row($record) or die(mysql_error());
//select all data form first row from the record
$data = mysql_fetch_array($record);
//coding check whether stock less than 3 (2 or less)
if( $total < 3 ) {
$to =
'wan@example.com';
$subject = 'Warning! Less stock...';
$message = 'Please add your stock! Your stock is already less than 3 right now...';
$headers = 'From:
nfsmohamad@gmail.com'
. "\r\n"
. "Reply-To:wan@example.com"
. "\r\n"
. "X-Mailer: PHP/" . phpversion();
if(mail($to, $subject, $message, $headers)) {
echo "Email sent successfully!";
} else {
echo "<script>alert('Failure: Email was not sent!')</script>";
}
}
?>
Does not get error but not successful to get email alert.
Hopefully anybody can help me...
