Trigger autoresponder using PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mancroft
Forum Newbie
Posts: 1
Joined: Sat May 15, 2004 4:29 am

Trigger autoresponder using PHP

Post by mancroft »

Trigger autoresponder using PHP

I am doing an autoresponder where a user types their email address into a form and then they get sent a response. I know how to do this.

But, in addition, I want to send further (different) messages automatically. Say, one a week later and another a week after that.

What is the best way to set the time for these messages in PHP?

I need to use PHP to trigger sending the messages.

PLEASE do not suggest setting a cron job manually it must be done using the PHP script.
mjseaden
Forum Contributor
Posts: 458
Joined: Wed Mar 17, 2004 5:49 am

Post by mjseaden »

As far as I'm aware, if you want an script to be run but you're not actually there to do it, cron is the only way. I don't understand what you mean 'cron job manually' - cron allows you to schedule running of scripts automatically at given times. It's great.

Mark
User avatar
launchcode
Forum Contributor
Posts: 401
Joined: Tue May 11, 2004 7:32 pm
Location: UK
Contact:

Post by launchcode »

It cannot be done using a pure PHP script unless you want to have that script open in a browser, refreshing every second, waiting for the right time to send stuff out (which is far from ideal!)

You will need to use something similar to cron (or cron itself if available) to call your php script every X hours/days/weeks/blah.
Post Reply