massive mails & timeout

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • stefano.troiani@gmail.com

    massive mails & timeout

    Hi,

    I have a web site that sends emails to some 17000 newsletter
    subscribers, the script takes about 5 minutes to complete the task,
    depending of the size of the attachment.
    The problem is that sometime it takes so much time that is difficult
    to know if something is going wrong, and sometimes the script
    terminates with timeout.
    I thought to solve the timeout question with a set_limit_time( ) but i
    am not sure where to put this line: inside the loop that send emails
    or at the beginning of the page?
    Second question is, how to control the flow and avoid that the site
    administrator close the browser or click the stop button thinking that
    the site is not working? could register_shutdo wn_function be the
    solution?

    thanks,

    stefano
  • C. (http://symcbean.blogspot.com/)

    #2
    Re: massive mails & timeout

    On 3 Oct, 10:34, "stefano.troi.. .@gmail.com"
    <stefano.troi.. .@gmail.comwrot e:
    Hi,
    >
    I have a web site that sends emails to some 17000 newsletter
    subscribers, the script takes about 5 minutes to complete the task,
    depending of the size of the attachment.
    The problem is that sometime it takes so much time that is difficult
    to know if something is going wrong, and sometimes the script
    terminates with timeout.
    I thought to solve the timeout question with a set_limit_time( ) but i
    am not sure where to put this line: inside the loop that send emails
    or at the beginning of the page?
    Second question is, how to control the flow and avoid that the site
    administrator close the browser or click the stop button thinking that
    the site is not working? could register_shutdo wn_function be the
    solution?
    >
    Have a google for php long running process.

    The short answer is that you're never going to get this running
    reliably on a remote server via a browser - run it from the comand
    line.

    C.

    Comment

    • Jerry Stuckle

      #3
      Re: massive mails &amp; timeout

      stefano.troiani @gmail.com wrote:
      Hi,
      >
      I have a web site that sends emails to some 17000 newsletter
      subscribers, the script takes about 5 minutes to complete the task,
      depending of the size of the attachment.
      The problem is that sometime it takes so much time that is difficult
      to know if something is going wrong, and sometimes the script
      terminates with timeout.
      I thought to solve the timeout question with a set_limit_time( ) but i
      am not sure where to put this line: inside the loop that send emails
      or at the beginning of the page?
      Second question is, how to control the flow and avoid that the site
      administrator close the browser or click the stop button thinking that
      the site is not working? could register_shutdo wn_function be the
      solution?
      >
      thanks,
      >
      stefano
      >
      Don't even try to send that many emails from a web page. Do it
      asynchronously instead.

      Rather, save the information in a database and run a cron job to send a
      few, then restart itself to send a few more. Or use one of the many
      bulk email packages out there (which basically do the same thing).

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • DaanK Interworking

        #4
        Re: massive mails &amp; timeout

        On 3 okt, 11:34, "stefano.troi.. .@gmail.com"
        <stefano.troi.. .@gmail.comwrot e:
        Hi,
        >
        I have a web site that sends emails to some 17000 newsletter
        subscribers, the script takes about 5 minutes to complete the task,
        depending of the size of the attachment.
        The problem is that sometime it takes so much time that is difficult
        to know if something is going wrong, and sometimes the script
        terminates with timeout.
        I thought to solve the timeout question with a set_limit_time( ) but i
        am not sure where to put this line: inside the loop that send emails
        or at the beginning of the page?
        Second question is, how to control the flow and avoid that the site
        administrator close the browser or click the stop button thinking that
        the site is not working? could register_shutdo wn_function be the
        solution?
        >
        thanks,
        >
        stefano
        We did a newsletter script for a customer a while ago that would send
        out 30k mails.
        All the newsletters (id's) went into a database, and a cronjob started
        a php script every 5 minutes or so.
        The script checked the database for new newsletters to send and would
        send them out in bursts of 180 letters per 5 minutes.

        We don't send all the newsletters at once because of the possibility
        of getting the mailserver blacklisted.

        Hope it helps

        Cheers

        Daniel

        Comment

        • stefano.troiani@gmail.com

          #5
          Re: massive mails &amp; timeout

          On 3 oct, 15:23, DaanK Interworking <daankinterwork ...@gmail.com>
          wrote:
          On 3 okt, 11:34, "stefano.troi.. .@gmail.com"
          >
          >
          >
          <stefano.troi.. .@gmail.comwrot e:
          Hi,
          >
          I have a web site that sends emails to some 17000 newsletter
          subscribers, the script takes about 5 minutes to complete the task,
          depending of the size of the attachment.
          The problem is that sometime it takes so much time that is difficult
          to know if something is going wrong, and sometimes the script
          terminates with timeout.
          I thought to solve the timeout question with a set_limit_time( ) but i
          am not sure where to put this line: inside the loop that send emails
          or at the beginning of the page?
          Second question is, how to control the flow and avoid that the site
          administrator close the browser or click the stop button thinking that
          the site is not working? could register_shutdo wn_function be the
          solution?
          >
          thanks,
          >
          stefano
          >
          We did a newsletter script for a customer a while ago that would send
          out 30k mails.
          All the newsletters (id's) went into a database, and a cronjob started
          a php script every 5 minutes or so.
          The script checked the database for new newsletters to send and would
          send them out in bursts of 180 letters per 5 minutes.
          >
          We don't send all the newsletters at once because of the possibility
          of getting the mailserver blacklisted.
          >
          Hope it helps
          >
          Cheers
          >
          Daniel
          Thanks for your answers, the problem is that I am not the sysadmin of
          the server, only the webmaster and I don't have full access to it.

          @ Daniel, could you tell me more about your script? I have never done
          something similar, you can use my private email if you like it.

          many thanks,

          stefano

          Comment

          Working...