/    Sign up×
Community /Pin to ProfileBookmark

due date reached send auto mail

__(Added `[code]…[/code]` tags ~ MOD)__

hi friends
i have create Equipment Calibration tracker web tool
i have create due date reached send auto mail program using php and mysql but not working
kindly help me .this my code

[code]
<?php

$currentDate = date(‘Y-m-d’); //this will get the current date
include(“dbconnection.php”);

$remind_query1 = “SELECT * FROM addequ WHERE edate = ‘$currentDate’ “; //Sql query to find users that reminders dates match current date.

if($run1 = $dbcon->query($remind_query1))
{
$rows = $run1->num_rows;

for ($j = 0; $j < $rows; ++$j)//loop through each user in results and send a reminder email.
{
$run1->data_seek($j);
$row = $run1->fetch_array(MYSQLI_NUM);

$to = “[email protected]”; //gets the user email address
$subject = “Equipment Calibration Reminder”;
$message = “Hi “.$row[‘slno’].”n “.$row[‘ename’].” n Experied in “.$row[‘edate’].” n need to Calibrate here”;
$headers = “[email protected]”;

mail($to,$subject,$message,$headers);
}

}
?>
[/code]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogDec 04.2019 — First thing I'd do is add the following after the if() block in case it did not execute:
<i>
</i>}
else {
// do something more user-friendly, but for now...
echo "&lt;pre&gt;IF failed:n".var_export($run1, 1)."&lt;/pre&gt;";
}

It would probably also help for now to make sure you're seeing all errors/warnings:
<i>
</i>&lt;?php
ini_set('display_errors', true); // set to false in production
error_reporting(E_ALL);

// rest of code...
×

Success!

Help @Ezhilarasan spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...