SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to tell PHP to send a specific e-mail at a specific time (newsletter)

    Hi,

    How to tell PHP to send a specific e-mail at a specific time (newsletter)

    Tanks.

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Create a db table to store the e-mails to be sent; specify the time when. Run a script periodically that would check through the queue and send the e-mails when their time is up.
    Saul

  3. #3
    SitePoint Member
    Join Date
    Jun 2007
    Location
    Melbourne
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you run PHP under Windows, then you can use Task Scheduler to run the email function at specific time such as daily, weekly etc.

    Create a .cmd file that call that email function from the command line. Then add that cmd file to Task Scheduler.

  4. #4
    SitePoint Enthusiast Azmeen's Avatar
    Join Date
    Apr 2007
    Location
    Johor Bahru, Johor, Malaysia
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or, if you're on a Linux host, you should use a crontab for scheduling the execution of your script.
    I can help with Linux, Apache, MySQL and PHP stuff at most times.
    I may be able to assist in other general IT issues. Try me
    Web Sites I Run:
    HTNet | Welley Corporation | blings.info

  5. #5
    SitePoint Addict Iceman90's Avatar
    Join Date
    Mar 2006
    Location
    Calgary, Alberta, Canada
    Posts
    391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    as Azmeen said, If you're on a Linux server, use cron. That will be the easiest solution.

  6. #6
    SitePoint Evangelist ldivinag's Avatar
    Join Date
    Jan 2005
    Location
    N37 33* W122 3*
    Posts
    414
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by e_sukmawidjaja View Post
    If you run PHP under Windows, then you can use Task Scheduler to run the email function at specific time such as daily, weekly etc.

    Create a .cmd file that call that email function from the command line. Then add that cmd file to Task Scheduler.
    careful with TASK SCHEDULER.

    if your machine reboots (say auto updates), TS doesnt run as a service. so unless you have an auto login, non of your tasks will run...

    edit: at least for me, using win xp...
    leo d.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •