Queued or Delayed Email, is it possible with PHP?

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
marcuseby
Forum Newbie
Posts: 3
Joined: Wed Mar 19, 2003 2:47 am
Location: Vancouver B.C.

Queued or Delayed Email, is it possible with PHP?

Post by marcuseby »

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
pootergeist
Forum Contributor
Posts: 273
Joined: Thu Feb 27, 2003 7:22 am
Location: UK

Post by pootergeist »

do a search for 'mailer daemon' - should bring better results.

You'd want to run a cron job on an SMTP (or whatever mail protocol you use) scanner script and maybe one on a mailing list manager.

You might note though that Perl (yikes) performs tasks such as you want a tad better than PHP.
marcuseby
Forum Newbie
Posts: 3
Joined: Wed Mar 19, 2003 2:47 am
Location: Vancouver B.C.

Post by marcuseby »

pootergeist wrote: You'd want to run a cron job on an SMTP (or whatever mail protocol you use) scanner script and maybe one on a mailing list manager.
cron job, I'm sorry, but I might need a little more hand holding than that.
:oops:

Whats a cron job, and how much does it cost?

:P

m.
pootergeist
Forum Contributor
Posts: 273
Joined: Thu Feb 27, 2003 7:22 am
Location: UK

Post by pootergeist »

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.
superwormy
Forum Commoner
Posts: 67
Joined: Fri Oct 04, 2002 9:25 am
Location: CT

Post by superwormy »

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...?
marcuseby
Forum Newbie
Posts: 3
Joined: Wed Mar 19, 2003 2:47 am
Location: Vancouver B.C.

Post by marcuseby »

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 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.

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

Post by superwormy »

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
h2c357
Forum Newbie
Posts: 2
Joined: Thu Mar 27, 2003 2:01 am
Location: Lahore
Contact:

Post by h2c357 »

What you could do is write a PHP script to pull what to email out of MySQL and email it.
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???
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
Post Reply