Forum Moderators: coopster

Message Too Old, No Replies

time triggered e-mail

         

Robert Poole

8:43 am on Jun 8, 2007 (gmt 0)

10+ Year Member



Yes, it is problem number two in as many days. Surely I am the winner of the best programmer of all time award? I think so.

Anyway, on the site I am working on atm I would like to send out weekly e-mails, so I need a little piece of scripting that will execute at (for example) 9:00 Monday morning each week and run some code that will eventually send an e-mail. Is this even possible with just coding or will it require some software?!

I'll take any thoughts on the subject.

dreamcatcher

8:50 am on Jun 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Robert Poole, welcome to Webmaster World. :)

Have you looked into cron jobs/tabs [en.wikipedia.org]? Sounds like this is what you need. Most apache servers support them, which allows you to execute a certain piece of code at a certain time.

dc

Robert Poole

12:18 pm on Jun 8, 2007 (gmt 0)

10+ Year Member



Hello there Mr Dreamcatcher. To be perfectly honest I have not even heard of these cron jobs/tabs you speak of! But I shall have a little read! (and no doubt come running back to you when I can't get it to work :oP)

Cheers

oziman

1:03 pm on Jun 8, 2007 (gmt 0)

10+ Year Member



Hi Robert, and welcome to WebmasterWorld,

You don't mention if you're on shared hosting, unix, windows, etc and what code you're doing.

On a unix box you use cron from the command line, see [linuxhelp.net...] for details.

If you're using cPanel or any of the other web based systems many hosts use, there's usually an interface through there.

If you run into more issues, let us know.

O

Robert Poole

2:14 pm on Jun 8, 2007 (gmt 0)

10+ Year Member



Hi Robert, and welcome to WebmasterWorld,

You don't mention if you're on shared hosting, unix, windows, etc and what code you're doing.

On a unix box you use cron from the command line, see [linuxhelp.net...] for details.

If you're using cPanel or any of the other web based systems many hosts use, there's usually an interface through there.

If you run into more issues, let us know.

O

Hey Oziman

Honestly this question >> You don't mention if you're on shared hosting, unix, windows, etc and what code you're doing. << completely baffles me! I have no idea what unix is but I've heard it used a disgusting amount these last couple of days! Is it an alternative to Windows?

Anywho's, I've been browsing this page: [htmlcenter.com...] where it tells me (under Apache infos)

"First, you need access to Lynx. Running your PHP script will not require you to add any additional lines. You simply have to edit your /etc/crontab file and add the following line:

* * * * * lynx -dump http://www.example.com/cron.php"

Right now I'm at the stage where I've just got lynx browser installed and running, and after that I'm pretty baffled. I can web browse to the page I'm working on but that's about it. What the hell is my etc/crontab file? How do I change it? How does doing this help me?

Right now I'm riding the rollercoaster in the bemusement park but I shall try and find a slice of solid ground on which to place my feet.

Thanks for your help.

Roberto

[edited by: eelixduppy at 3:13 pm (utc) on June 8, 2007]
[edit reason] example.com [/edit]

jatar_k

2:17 pm on Jun 8, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



let's take a breath here

Welcome to WebmasterWorld Robert Poole,

now, before things get totally overwhelming, do you know what platform your site is hosted on?

type of unix machine or type of windows machine?

or, do you have an administration login for your site where you can manage your site?

Robert Poole

2:40 pm on Jun 8, 2007 (gmt 0)

10+ Year Member



Hey Jatar

Yes, breathing is a good idea, let's all go that.

I have been informed that the site is hosted on a windows thingamebob

I manage my site via FTP access :oS. FireFTP to be exactamundo.

Are we making progress now?

I feel so.

jatar_k

2:46 pm on Jun 8, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



yes we are

in windows there is no cron, they call it scheduled tasks

I think your best bet would be to ask your host if you have access to scheduled tasks on your server. If you do then the next question to them would be how to do it.

Robert Poole

11:49 am on Jun 12, 2007 (gmt 0)

10+ Year Member



Okay, so let's suppose that I'm uploading to a Unix server (apache) and that I can get in contact with the people in charge of the server and I can ask them to change the crontab file thing. What do I tell them to put in there?

Currently I have a file sendemail.php which runs through my database and sends an e-mail to all appropriate members. This is the file which needs to be executed every Monday morning at 9am GMT.

Thanks

jatar_k

2:36 pm on Jun 12, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



well you could just tell them you need to run sendmail.php every Monday morning at 9am GMT.

You could also take a look at the links in some of the above posts for the actual line you would need