Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

schedule email with php -- possible???

  • 28-07-2004 5:31pm
    #1
    Registered Users, Registered Users 2 Posts: 648 ✭✭✭


    Hi,
    can any one tell me is it possible, if im sending and email from a php form to in some way flag the smtp server not to send it until a certain time .ie 1 day or 5days time??

    Tnx


Comments

  • Registered Users, Registered Users 2 Posts: 944 ✭✭✭nahdoic


    I'm curious as to why you want to do this? Yes I am nosey.


  • Closed Accounts Posts: 2,161 ✭✭✭steve-hosting36


    You could script it to write the submissions to a file or database, then have another script that checks the timestamps every 5 minutes? and sends email based on a schedule, etc...


  • Closed Accounts Posts: 1,166 ✭✭✭Johnny Versace


    Why not just do it simply -

    1. Write your script.
    2. Set up a cronjob.


  • Registered Users, Registered Users 2 Posts: 648 ✭✭✭ChicoMendez


    Johnny, steve
    indded they are solutions.

    however i was just wondering if it was possible to edit the header info of an email so as its not sent until a certain time.... would be so much easier ey?


  • Registered Users, Registered Users 2 Posts: 7,740 ✭✭✭mneylon


    The only way you can do it realistically is using cron. Either cron it to send the mail at set intervals, or to query a database or whatever to send it. Email headers do not allow you to schedule emails.


  • Advertisement
  • Closed Accounts Posts: 2,161 ✭✭✭steve-hosting36


    Changing the header will effect the date the end user sees for the mail receipt, it wont effect when they actually receive it.


  • Registered Users, Registered Users 2 Posts: 7,740 ✭✭✭mneylon


    Originally posted by steve-hosting36
    Changing the header will effect the date the end user sees for the mail receipt, it wont effect when they actually receive it.
    Not even.
    You can only forge so much of it.
    You can spoof the sending time from the sending user, but you can't do much about the email servers along the way, as they will automatically add their info to it.
    The only time I've seen something "break" that is when email got trapped on a mail server just before it was taken offline or shutdown. As soon as it came back online it started processing its queue, even though the mails were now completely out of sync with everyone else (in one case over 18 months).


  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    Loading any mails into a DB and cron jobs sound like the best option. If you want a form whereby you put in the time that you want the mail to send, then set the cron job to run every 5 minutes or so, and send out any mails on or within 2.5 mins of that time.

    If this is really something that you absolutely must have, look into writing your scripts in ASP/VBScript and using an Exchange server - if you have access to the software. Exchange allows you to schedule mails for delivery at a certain time, and there are modules written for ASP/Exchange interaction.


Advertisement