Jump to content


Send mail at a specified time?


  • Please log in to reply
4 replies to this topic

#1 Guest_convention_*

Guest_convention_*
  • Guests

Posted 20 October 2006 - 06:16 PM

In PHP, is it possible to send mail (or, execute the mail() function) at a specified time? Thanks. :)

#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 20 October 2006 - 06:24 PM

You'll need to run a cron job for that.

Orio.
Think you're smarty?

(Gone until 20 to November)

#3 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 20 October 2006 - 06:33 PM

You'll need to run a cron job for that.

Orio.


or, if you're running on linux, and you only need it to run once, just set up an "at" command
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#4 Guest_convention_*

Guest_convention_*
  • Guests

Posted 20 October 2006 - 09:23 PM

You'll need to run a cron job for that.

Orio.


I did some research on cron jobs, and it seems you can only do that from the terminal. Is there any way to do this with just PHP? Thank you for the help.

#5 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 21 October 2006 - 12:23 PM

I did some research on cron jobs, and it seems you can only do that from the terminal. Is there any way to do this with just PHP? Thank you for the help.


nope. PHP is a script that is run by the server. CRON is simply a scheduled task that tells the server when to run your PHP script. you can't have your PHP running at specified times without setting up some way for your server to know when to run it.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users