Find the answer to your Linux question:
Results 1 to 5 of 5
hi guys, I need to develop a survey. It looks pretty straightforward except for the fact that it needs to email the participant after 3 weeks of submitting the survey. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User Allblack's Avatar
    Join Date
    May 2003
    Location
    Godzone
    Posts
    416

    sending automated email at specified date


    hi guys,

    I need to develop a survey. It looks pretty straightforward except for the fact that it needs to email the participant after 3 weeks of submitting the survey.

    I actually need to do it in ASP but I would also like to see a PHP solution
    I am on a journey to mastering Linux and I got a bloody long way to go!!!

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Well, I don't know how to do it in ASP, but in PHP on a POSIX system, just make it call the following shell code (be sure to get the quoting right):
    Code:
    echo 'mail -s Subject address@mail.tld </path/to/message' | at now + 3 weeks
    At least I'd say that's the easiest.

  3. #3
    Linux User Allblack's Avatar
    Join Date
    May 2003
    Location
    Godzone
    Posts
    416
    The PHP solution above that Dolda gave does not work. I have fiddled around a bit and tried the following:
    Code:
    <?
    `mail -s subject me@mydomain.com | at now + 5`
    ?>
    I also tried
    Code:
    `mail -s subject me@mydomain.com` | at now + 5
    These get send immediately and not after 5 minutes. Does anyone have another idea?

    Cheers
    I am on a journey to mastering Linux and I got a bloody long way to go!!!

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User Allblack's Avatar
    Join Date
    May 2003
    Location
    Godzone
    Posts
    416
    I have given up on the idea. I did not think about the fact that the ATQ will be emptied at reboot and this can cause problems
    I am on a journey to mastering Linux and I got a bloody long way to go!!!

  6. #5
    Linux User
    Join Date
    Jan 2003
    Location
    Cardiff, Wales
    Posts
    478

    cron

    why not setup a database which stores these addresses and dates for the emails. then write a script to do the emailing. then set a cron job to run the script every night
    No trees were harmed during the creation of this message. Its made from a blend of elephant tusk and dolphin meat.

Posting Permissions

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