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

Sending e-mail notifications

Options
  • 23-01-2008 12:28pm
    #1
    Closed Accounts Posts: 81 ✭✭


    I'm writing a web application in PHP. The application needs to be able to send e-mails to its users. My concern is that if the script goes to send an e-mail and the SMTP server is down or if there is a loss in network connectivity then the email won't be sent.

    So my approach is to store the emails in a database table and have a helper process/scheduled task query the table every interval for new emails to send and attempt to send them. But I can't imagine that commercial web hosting company would allow you to run such processes on their servers.

    So my question is how software like vBulletin approaches the problem? Does anyone have any knowledge on this?

    Thanks in advance.


Comments

  • Registered Users Posts: 413 ✭✭ianhobo


    In my own work, and for hosted enviroments with email, the services are usually sold with a certain of "up" time, so you can be confident 99% of the time that a mail will have sent. If not, you'll certainly know about it as most likely it will be a problem that will affect many people! So I would usually only incorporate a minimul redundancy plan, and at that it might not be automated to conserve resources. If an email fault occurs, you will most likely know about it, so invoking a back up plan manually would probably be acceptable

    Also, when you buy hosting, you are also purchasing a certain amount of implied cpu time, if yo uchoose to use that time to run database queries as oppossed to serve pages, I guess thats up to you! But that sort of stuff would vary with each hosting company.


  • Closed Accounts Posts: 81 ✭✭dzy


    ianhobo wrote: »
    In my own work, and for hosted enviroments with email, the services are usually sold with a certain of "up" time, so you can be confident 99% of the time that a mail will have sent. If not, you'll certainly know about it as most likely it will be a problem that will affect many people! So I would usually only incorporate a minimul redundancy plan, and at that it might not be automated to conserve resources. If an email fault occurs, you will most likely know about it, so invoking a back up plan manually would probably be acceptable

    Also, when you buy hosting, you are also purchasing a certain amount of implied cpu time, if yo uchoose to use that time to run database queries as oppossed to serve pages, I guess thats up to you! But that sort of stuff would vary with each hosting company.

    Thanks for your reply. The emails are very central to the way the applications functions and must be sent all the time. A helper process would only run a single query about once every minute to retrieve unsent emails - so the cost would be negligible.

    I'll suppose I'll just check with the hosting companies to see :)


  • Registered Users Posts: 2,790 ✭✭✭John_Mc


    dzy wrote: »
    Thanks for your reply. The emails are very central to the way the applications functions and must be sent all the time. A helper process would only run a single query about once every minute to retrieve unsent emails - so the cost would be negligible.

    I'll suppose I'll just check with the hosting companies to see :)

    I would approach this by attempting to send the emails straight away. In the event of an exception being caught, I'd add the email to the DB table for sending later on


  • Closed Accounts Posts: 81 ✭✭dzy


    John_Mc wrote: »
    I would approach this by attempting to send the emails straight away. In the event of an exception being caught, I'd add the email to the DB table for sending later on

    I suppose I could do it that way. And then have a script that could be manually invoked to send those unsent mails.

    Thanks.


  • Registered Users Posts: 2,790 ✭✭✭John_Mc


    dzy wrote: »
    I suppose I could do it that way. And then have a script that could be manually invoked to send those unsent mails.

    Thanks.

    Or you could check the DB table for unsent emails once an email has been successfully sent, no need for manual intervention that way


  • Advertisement
Advertisement