casilda Posted February 17, 2010 Share Posted February 17, 2010 Basically it is.. I have a Admin page- > In this the admin wil be able to create a user by entering in his particulars: eg: user name, password for the user, telephone and email address.. The user will able to login using this username and password. Once they log in, they see a form which has to be filled in by them,,..once they submit the form, the form details is passed on to the admin..If the user has sumitted the form, then its completed.. What i need is an Auto reminder for the users to remind them to fill in the report form and send it.. the email address is taken from the user table, that the admin has created... eg: lets say the user has to submit the report on march Then an auto reminder has to be sent on Feb 1st. If the user has not yet submitted the form, a 2nd auto reminder must be sent on Feb 7th. if again he hasnt submitted then another auto reminder has to be sent on Feb 21st.. So, total 3 auto reminders upon checking of conditions,....If the user has submitted the report no need to send auto reminders. The server has to run the php script on its own.. I think this is done using CRONJOB in the cpanel..But i dont have any idea on it,,,I read through many resources, but coudnt get any idea... Can someone help..I need this immediately.. Ur help is much appreciated... Thanks again.. Quote Link to comment https://forums.phpfreaks.com/topic/192355-auto-email-reminder-upon-conditions/ Share on other sites More sharing options...
trq Posted February 17, 2010 Share Posted February 17, 2010 Do you need help with the script or getting the script to execute periodically via cron? Quote Link to comment https://forums.phpfreaks.com/topic/192355-auto-email-reminder-upon-conditions/#findComment-1013581 Share on other sites More sharing options...
casilda Posted February 17, 2010 Author Share Posted February 17, 2010 Actually its both.. for the php script..i coudnt get it right and regarding the cron..no idea of it.. Quote Link to comment https://forums.phpfreaks.com/topic/192355-auto-email-reminder-upon-conditions/#findComment-1013582 Share on other sites More sharing options...
trq Posted February 17, 2010 Share Posted February 17, 2010 You need to post your actual problematic code then and a description of your problem. As for cron, it really is a Linux question, not related to php. I see you use Cpanel though, it should be pretty straight forward to setup cron to execute a given script at a given time. Quote Link to comment https://forums.phpfreaks.com/topic/192355-auto-email-reminder-upon-conditions/#findComment-1013583 Share on other sites More sharing options...
casilda Posted February 17, 2010 Author Share Posted February 17, 2010 <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("db", $con); $sql = "SELECT c_name, c_email FROM company_creator"; $result = mysql_query($sql); while ($row = mysql_fetch_assoc($result)) { $to = "'" . $row['c_name'] . "' <" . $row['c_email'] . ">"; $subject = "RE: The subject"; $message = "Your message goes here"; $headers = 'From: noreply@gmail.com' . "\r\n" . 'Reply-To: noreply@gmail.com' . "\r\n" . 'X-Mailer: AnythingYouWant.0' ; $success = mail($to,$subject,$message,$headers); } ?> It gives me error in here -- > $success = mail($to,$subject,$message,$headers); Failed to connet to mail server, verify your SMTP and smtp_port I am using a localhost.. how to set the mail server.. Quote Link to comment https://forums.phpfreaks.com/topic/192355-auto-email-reminder-upon-conditions/#findComment-1013585 Share on other sites More sharing options...
trq Posted February 17, 2010 Share Posted February 17, 2010 I am using a localhost.. how to set the mail server.. You would need to install and configure a mail server. Quote Link to comment https://forums.phpfreaks.com/topic/192355-auto-email-reminder-upon-conditions/#findComment-1013587 Share on other sites More sharing options...
casilda Posted February 17, 2010 Author Share Posted February 17, 2010 Could you guide me how to set it... Quote Link to comment https://forums.phpfreaks.com/topic/192355-auto-email-reminder-upon-conditions/#findComment-1013588 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.