Scheduling E-mail Reminders With Php

liunx

Guest
Hi all!<br /><br />I have an existing PHP/MySQL calendar script that I've written that I would like to add more functionality to. One of the things I'd like to do with it is to have the ability to e-mail scheduled event reminders to people. Basically, I'd like to enter an event into the calendar, select it to also be sent as a reminder <i>X</i> number of days before the event happens, and have it automatically sent at the specified time to a list of people's e-mail addresses who have expressed interest in receiving news. The calendar is edited through a custom PHP interface designed for non-technical folks. That part of it I have covered, but the part I'm not sure of is how to get this PHP script to schedule and execute the mailing of the reminders, and also how to send it to a list of recipients. I looked at the mailing list function in cpanel, but it seems over complex for what I need. I don't need (or want) the recipients to be able to mail each other. I'd kind of like it to work like the e-mail reminder you get from this forum when someone replies to your subscribed topic.<br /><br />Any thoughts on how I could go about this?<br /><br />Thanx!<!--content-->
I can make a couple suggestions at the concept level...<br /><br />You could set it up as a cron job to run once a day, and check your list of events in the database. If any show up as X days away, then generate the notification.<br /><br />As for emailing the recipients, you could again have the list of recipients in your database (if you want it somewhere you can easily maintain it) and have the notification script generate a separate email per individual (if the number of individuals isn't huge). Another way it to include all of the individuals as BCC recipients, but that can tend to get caught in spam filters.<!--content-->
That's a great idea! I didn't think of just having a Cron that would run a program to check the database daily. Thanks! That should solve my problem and be really simple to set up. As for the mailing list, placing the addresses in the database is preferrable and mailing individually is also a very good solution. Thanks again!<br /><br />Will there be any problems with e-mailing large numbers of messages automatically at one time through the mail server? ie. Are there limitations in place to prevent spamming? This script is in no way designed for spamming, but if the list of recipients gets large (100+ is expected), I wouldn't want to be causing any problems.<!--content-->
Yes, you will run into problems trying to send that many emails out at once.<br /><br />Space the emailer out among 3 or 4 hours.<!--content-->
Any idea what is the maximum number of messages I could safely send at one time? Would it make a difference if they were BCCed?<!--content-->
I believe 50 and yes, BCC counts. I would set it to 45 to be sure.<!--content-->
That's doable. 45 at a time, spaced out by 4 hours. Sounds good! Thanks. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /><!--content-->
Can anyone point me to a site containing some CRON scripts I can use as an example or to get ideas from?<br /><br />I am rather new to this kind of thing, but I do have something in mind I want to run CRON wise every couple of weeks.<br /><br />Thanks!<!--content-->
 
Back
Top