Auto generate mail to respective user + php

Discussion in 'PHP' started by ksamir2004, Apr 25, 2008.

  1. #1
    Hi All,

    How to auto generate mail if given deadline over. any idea please share with us.

    i have two date;


    <?php

    i want to generate mail before 5 days form specified deadline

    if i will write funtion like
    if($days<=5)

    then it will send many times mail in a days..

    i need one alert mail

    Thanks
    Sam
     
    ksamir2004, Apr 25, 2008 IP
  2. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #2
    This script will do something 5 days, 6 days, 7 days, etc before deadline.
    
    
    // The date format must be YYYY-MM-DD
    $date2 = "2008-12-25";//(Deadline date)
    $date2_i = strtotime($date2);
    
    $how_many = 5 * 24 * 3600;// 5 days in seconds
    
    $now = time();
    
    if ($now < $date2_i - $how_many) {// if 5 (or more) days before deadline
          // do something here
    }
    
    PHP:
     
    xrvel, Apr 25, 2008 IP
  3. ksamir2004

    ksamir2004 Peon

    Messages:
    70
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Its not working properly.. main thing there is some data in database.. data should also go through mail.
    so i am facing these kind of problem..

    i know its possable.. plz give me some hints..

    Thanx
    sam
     
    ksamir2004, Apr 25, 2008 IP