Results 1 to 9 of 9
  1. #1

    Issue with script timeouts - trying to send email mail shots - hosting recommendation

    Background is this - I look after a site for a recruitment agency, which has a backend mySQL database.

    It includes a table of potential candidates, which the site owner can search based on various criteria and then send all the returned candidates an email about potential jobs they might be interested in.

    I'm using an off the shelf script to send the emails, and have jumped through a few hoops to get this to work, but it looks like we need to move hosting unfortunately.

    The problem is the script timeout on the server - so even though its set to send emails slowly enough, ie under 500 emails an hour, because of that slow pace, it fails if it takes more then five minutes to send them all as the script times out.

    My understanding is that the script includes a line to reset the script timeout value to 0, so enabling the script to keep running until all the emails have been sent. But unfortunately our current hosting company does not allow the script timeout to be reset at the PHP level.

    So my question is this - is anyone doing anything similar, and if so, can you recommend any hosting company that does allow the script timeout to be reset at the PHP level?

    Because at the minute it seems like a frustrating catch-22 - slow it down to get around the spam issue, and it won't run long enough to send all the emails. Speed it up, and it falls foul of the script timeout.

    Any advise on this, or hosting suggestions most welcome!

    Thanks.

  2. #2
    Join Date
    Oct 2010
    Posts
    5,079
    Sounds like you need to recode the script so that it works on a batch basis. That's to say: It creates (in the database or in a file) some record of all the e-mails that need sending. It sends the first 50 and finishes. Five minutes later the script runs again and the first thing it does is read in the next <=50 emails from the queue and send them. It then finishes. That way, the emails are staggered but no script is running for more than a few seconds.

    Even if you could reset the timeout in some way, it's not stable. All kinds of other things could interrupt or crash your script, and then the remaining e-mails wouldn't be sent. Scripting a PHP script that takes over an hour to run is a bad idea - not just because your host has a timeout mechanism in place.

    Once you've moved the script to a batch method, not only will it be more stable, but you won't need to move hosts.

    That's my 2p anyway.
    Not as active on WHT as I used to be, but still drop in and receive email notifications from here.
    My personal blog site: https://www.oakleys.org.uk/blog

  3. #3
    Join Date
    Dec 2012
    Location
    New York
    Posts
    383
    +1 agree.Absolutely correct. Transforming your code into batch mode should solve your problem in a better way.
    Hostpaedia - Affordable, Reliable & Secure Web Hosting
    Web Hosting : Host Unlimited Websites, cPanel, Softaculous, Servers in USA and Germany
    Reseller Hosting : cPanel, Softaculous
    VPS Hosting : KVM VPS powered by Virtualizor

  4. #4
    Thanks guys. That does make sense, and is something the current hosting company said.

    Unfortunately I'm not really a PHP developer, and its a third party script. (Its Web Assist's Universal Email extension for Dreamweaver). Their stuff has served me well over the years and they have fantastic customer support, but they have advised me that it can't be changed to do the batches, not even with some custom, paid support. So kind of stuck really.

    They've recommended a couple of hosts that their stuff is tested with, but by the sounds of it, even if it works, its not ideal.

  5. #5
    Join Date
    Oct 2010
    Posts
    5,079
    OK - I'm curious. What hosts did they recommend?
    Not as active on WHT as I used to be, but still drop in and receive email notifications from here.
    My personal blog site: https://www.oakleys.org.uk/blog

  6. #6
    1 & 1 hosting and Dream Hosts.

    I've always used, and am happy to recommend UK Web Solutions Direct. I'm in the UK, and have always found them really good. if there ever is an issue, I know I'll get a reply from them within a couple of hours.

    The above look more like bigger companies, possibly with less good customer services.

    It is a bit of an odd one, as I've always had great support from Web Assist. Given how much they really seem to know their stuff, its strange that their Email extensions not only don't seem to work in the best way, but they don't think its anything they can easily change even with some custom changes.

  7. #7
    Join Date
    Oct 2010
    Posts
    5,079
    Quote Originally Posted by johngordon11 View Post
    1 & 1 hosting and Dream Hosts.

    I've always used, and am happy to recommend UK Web Solutions Direct. I'm in the UK, and have always found them really good. if there ever is an issue, I know I'll get a reply from them within a couple of hours.

    The above look more like bigger companies, possibly with less good customer services.
    They certainly are bigger. I've not used UK Web Solutions Direct, or 1&1 or Dream Host. But I'd be surprised if you get any better limits on e-mail sending or PHP timeout with the larger hosts. If anything, the larger the host the more you are a number and the less likely they will be able to accommodate you.

    Quote Originally Posted by johngordon11 View Post
    It is a bit of an odd one, as I've always had great support from Web Assist. Given how much they really seem to know their stuff, its strange that their Email extensions not only don't seem to work in the best way, but they don't think its anything they can easily change even with some custom changes.
    Have you tried the Web Assist community forums? If the PHP is unencrypted, moving to a batch mode may be a change that others have already made, or this may be a problem that others have encountered and found a way around.
    Not as active on WHT as I used to be, but still drop in and receive email notifications from here.
    My personal blog site: https://www.oakleys.org.uk/blog

  8. #8
    I'm waiting to hear back from 1&1 - they are mentioned on the WA site prominently enough to suggest there's some link between them and WA. But obviously would want to confirm it would at least work in theory before we thought about moving hosting.

    I posted on the WA forums originally, but got no joy, even asking them if they could do some custom changes that I'd be happy to pay for, but was a no go.

    And these guys usually go well above the call of duty - I've had them on the phone for hours in Adobe connect sessions doing custom stuff before, often at no extra charge. So this is an odd one!

    I'll post again, more specifically about the batch way of doing things, not that I'm clearer about the problem and the ideal solution.

    Thanks for posting back here though.

  9. #9
    Join Date
    Oct 2010
    Posts
    5,079
    Quote Originally Posted by johngordon11 View Post
    I'm waiting to hear back from 1&1 - they are mentioned on the WA site prominently enough to suggest there's some link between them and WA.
    Spot on.

    They mask the outbound links to 1&1 (and GoDaddy, HostGator and the other 2 hosts they recommend) with a http://../goto/1and1 type link, which almost certainly means those are affiliate links.

    They are recommending hosts that give them a payback when a referee signs up. That need not mean that they are not good choices of host (although a few searches on here for some of them would give you some interesting feedback), but it certainly means their advice is not unbiased.
    Not as active on WHT as I used to be, but still drop in and receive email notifications from here.
    My personal blog site: https://www.oakleys.org.uk/blog

Similar Threads

  1. DNS Issue - Can't send mail to myself!
    By FantasticFred in forum Hosting Security and Technology
    Replies: 9
    Last Post: 11-22-2012, 02:32 PM
  2. Cannot send email to yahoo.com mail only. Help !!!!!!
    By basketmen in forum Hosting Security and Technology
    Replies: 28
    Last Post: 11-19-2010, 06:32 PM
  3. Cannot send email through Squirrel Mail ...
    By mickscool in forum Hosting Security and Technology
    Replies: 6
    Last Post: 07-27-2008, 07:56 PM
  4. mail script wont send email
    By latheesan in forum Programming Discussion
    Replies: 9
    Last Post: 12-13-2005, 05:04 PM
  5. How to secure email/send mail in cpanel so only internal can send mail?
    By Dann2 in forum Hosting Security and Technology
    Replies: 11
    Last Post: 07-07-2003, 01:07 PM

Posting Permissions

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