I've been looking through Google like a madman.
Seen around 300 pages, and nothing on how to send emails via PHP queued or delayed.
Does anyone know of a class, component, installation, something, that solves this problem.
I want my emails to be sent at specific times, and I don't own my own server, I use A+ hosting, and while they are guru's at what they do, they didn't have a clue how to send queued email. I need a solution that they will allow on their server. (IE: Not a security risk)
Any thoughts?
Marcus
Queued or Delayed Email, is it possible with PHP?
Moderator: General Moderators
-
pootergeist
- Forum Contributor
- Posts: 273
- Joined: Thu Feb 27, 2003 7:22 am
- Location: UK
-
pootergeist
- Forum Contributor
- Posts: 273
- Joined: Thu Feb 27, 2003 7:22 am
- Location: UK
cron is the unix system for scheduling execution of a script or program. If you control panel doesn't offer it, you would need telnet/shell access. You would want it to call the script every hour (or perhaps every ten mins) and check the mail outbox.
failing that, you would need some form of http request which would mean having a browser open to the script URL constantly - which is a bad bad thing.
failing that, you would need some form of http request which would mean having a browser open to the script URL constantly - which is a bad bad thing.
-
superwormy
- Forum Commoner
- Posts: 67
- Joined: Fri Oct 04, 2002 9:25 am
- Location: CT
Why not everytime someone wants to send an email, stick it into MySQL with a date / time field.
Then use a cron job:
http://www.unixgeeks.org/security/newbi ... ron-1.html
To run a script once an hour or whatever that pulls all the stuff thats not sent from MySQL and sends it...?
Then use a cron job:
http://www.unixgeeks.org/security/newbi ... ron-1.html
To run a script once an hour or whatever that pulls all the stuff thats not sent from MySQL and sends it...?
Thanks Superwormy, I read the instructions on how to use it, and it looks pretty straight forward, (but may I email you for a code example or at least to look at mine, if thats ok?) one question stands out though, can cron run a PHP script/page at a timed interval? (Since my perl isn't exactly up to par) Since I know how to script something from MySQL in PHP very quickly, but anything else will have a larger learning curve.superwormy wrote:Why not everytime someone wants to send an email, stick it into MySQL with a date / time field.
Then use a cron job:
http://www.unixgeeks.org/security/newbi ... ron-1.html
To run a script once an hour or whatever that pulls all the stuff thats not sent from MySQL and sends it...?
Thanks, (you too pootergeist).
Marcus
-- The Candle that burns Twice as Bright, burns Half as Long
-
superwormy
- Forum Commoner
- Posts: 67
- Joined: Fri Oct 04, 2002 9:25 am
- Location: CT
srry was away during weekend, keithp@logosoftwear.com
What you could do is write a PHP script to pull what to email out of MySQL and email it.
Then use cron to execute a task like this:
wget http://www.yourdomainname.com/schedulescript.php
What you could do is write a PHP script to pull what to email out of MySQL and email it.
Then use cron to execute a task like this:
wget http://www.yourdomainname.com/schedulescript.php
What I understand is that you sayin to insert a date field in MySQL and run a PHP script that checks the database at some interval (maybe 1 hour or any thing) and check the system date with the specified date and if matched, send the mail???What you could do is write a PHP script to pull what to email out of MySQL and email it.
Is it so? if its not what you said would you kindly tell is there some thing wrong in it? In my opinion checking the database regularly isnt a performance bottleneck or is it?
bio