Send an email automatically? is it possible?

Send an email automatically? is it possible?

am 16.01.2008 15:27:42 von nn

I need to send an email automatically every week to the users in a
database that meet a certain criteria.
the way i implemented this, so far, is that when the admin logs into
the index.php, the email is sent if it wasn't sent that week already
..
the problem i'm facing is that if the admin doesn't login for a whole
week this email doesn't get sent.

is there a way to execute this index.php automatically every week?

BTW my server supports both php4 and php5 and runs linux.

thank you very much,
NN

Re: Send an email automatically? is it possible?

am 16.01.2008 16:25:10 von Ivan Marsh

On Wed, 16 Jan 2008 08:27:42 -0600, NN wrote:

> I need to send an email automatically every week to the users in a
> database that meet a certain criteria. the way i implemented this, so
> far, is that when the admin logs into the index.php, the email is sent
> if it wasn't sent that week already .
> the problem i'm facing is that if the admin doesn't login for a whole
> week this email doesn't get sent.
>
> is there a way to execute this index.php automatically every week?
>
> BTW my server supports both php4 and php5 and runs linux.

man cron

--
I told you this was going to happen.

Re: Send an email automatically? is it possible?

am 16.01.2008 19:30:28 von Steve

"NN" wrote in message
news:ap4so31df6d0pftjbub5khe2dptaa4dolr@4ax.com...
>I need to send an email automatically every week to the users in a
> database that meet a certain criteria.
> the way i implemented this, so far, is that when the admin logs into
> the index.php, the email is sent if it wasn't sent that week already
> .
> the problem i'm facing is that if the admin doesn't login for a whole
> week this email doesn't get sent.
>
> is there a way to execute this index.php automatically every week?

yes.

Re: Send an email automatically? is it possible?

am 17.01.2008 00:56:29 von nn

On Wed, 16 Jan 2008 09:25:10 -0600, Ivan Marsh
wrote:

>On Wed, 16 Jan 2008 08:27:42 -0600, NN wrote:
>
>> I need to send an email automatically every week to the users in a
>> database that meet a certain criteria. the way i implemented this, so
>> far, is that when the admin logs into the index.php, the email is sent
>> if it wasn't sent that week already .
>> the problem i'm facing is that if the admin doesn't login for a whole
>> week this email doesn't get sent.
>>
>> is there a way to execute this index.php automatically every week?
>>
>> BTW my server supports both php4 and php5 and runs linux.
>
>man cron

thanks!

will it execute a php file?
or it works only with binaries?

10 14 * * 1 /path/to/file/index.php

thanks again,
NN

Re: Send an email automatically? is it possible?

am 17.01.2008 01:07:11 von Ivan Marsh

On Wed, 16 Jan 2008 17:56:29 -0600, NN wrote:

> On Wed, 16 Jan 2008 09:25:10 -0600, Ivan Marsh wrote:
>
>>On Wed, 16 Jan 2008 08:27:42 -0600, NN wrote:
>>
>>> I need to send an email automatically every week to the users in a
>>> database that meet a certain criteria. the way i implemented this, so
>>> far, is that when the admin logs into the index.php, the email is sent
>>> if it wasn't sent that week already . the problem i'm facing is that
>>> if the admin doesn't login for a whole week this email doesn't get
>>> sent.
>>>
>>> is there a way to execute this index.php automatically every week?
>>>
>>> BTW my server supports both php4 and php5 and runs linux.
>>
>>man cron
>
> thanks!
>
> will it execute a php file?
> or it works only with binaries?
>
> 10 14 * * 1 /path/to/file/index.php

I don't do much command line php but I'm sure someone else here can help
you out.

The cron line would need to include the php executable so it would be
something like:

10 14 * * 1 /usr/bin/php.exe /path/to/file/index.php

(That may not be where the php.exe resides.

--
I told you this was going to happen.

Re: Send an email automatically? is it possible?

am 17.01.2008 03:09:39 von nn

On Wed, 16 Jan 2008 18:07:11 -0600, Ivan Marsh
wrote:

>On Wed, 16 Jan 2008 17:56:29 -0600, NN wrote:
>
>> On Wed, 16 Jan 2008 09:25:10 -0600, Ivan Marsh wrote:
>>
>>>On Wed, 16 Jan 2008 08:27:42 -0600, NN wrote:
>>>
>>>> I need to send an email automatically every week to the users in a
>>>> database that meet a certain criteria. the way i implemented this, so
>>>> far, is that when the admin logs into the index.php, the email is sent
>>>> if it wasn't sent that week already . the problem i'm facing is that
>>>> if the admin doesn't login for a whole week this email doesn't get
>>>> sent.
>>>>
>>>> is there a way to execute this index.php automatically every week?
>>>>
>>>> BTW my server supports both php4 and php5 and runs linux.
>>>
>>>man cron
>>
>> thanks!
>>
>> will it execute a php file?
>> or it works only with binaries?
>>
>> 10 14 * * 1 /path/to/file/index.php
>
>I don't do much command line php but I'm sure someone else here can help
>you out.
>
>The cron line would need to include the php executable so it would be
>something like:
>
>10 14 * * 1 /usr/bin/php.exe /path/to/file/index.php
>
>(That may not be where the php.exe resides.

thank you very much.

NN

Re: Send an email automatically? is it possible?

am 17.01.2008 06:13:11 von Shion

NN wrote:

> will it execute a php file?
> or it works only with binaries?
>
> 10 14 * * 1 /path/to/file/index.php

In some better distributions you can add a

#!/path/to/bin/php

on to of the file and then

chmod 755 /path/to/file/index.php

in that case you can use the line you wrote.

--

//Aho

Re: Send an email automatically? is it possible?

am 18.01.2008 01:01:31 von nn

On Thu, 17 Jan 2008 06:13:11 +0100, "J.O. Aho"
wrote:

>NN wrote:
>
>> will it execute a php file?
>> or it works only with binaries?
>>
>> 10 14 * * 1 /path/to/file/index.php
>
>In some better distributions you can add a
>
>#!/path/to/bin/php
>
>on to of the file and then
>
>chmod 755 /path/to/file/index.php
>
>in that case you can use the line you wrote.

thank you very much,

NN