Newsletter script in PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nicolas

    Newsletter script in PHP

    Hello,

    I have programmed an application to manage newsletters in PHP. I send the
    mails using smtp, but when there are more than 500 subscribers and when the
    mails (in html) are too big, it is really slow.

    What can I do gain speed ?

    Thanks,

    Nicolas


  • Paulus Magnus

    #2
    Re: Newsletter script in PHP

    "Nicolas" <nicolasNO@SPAM lomitko.com> wrote in message
    news:bovjvk$1ts v$1@biggoron.ne rim.net...[color=blue]
    > Hello,
    >
    > I have programmed an application to manage newsletters in PHP. I send the
    > mails using smtp, but when there are more than 500 subscribers and when[/color]
    the[color=blue]
    > mails (in html) are too big, it is really slow.
    >
    > What can I do gain speed ?[/color]

    Have you looked at using phpMailer? It's a very good mail handling class for
    PHP that's completely free but has a lot of built-in functionality for
    handling large quantities of mail. I've never used it for sending those
    sorts of quantities of mail but there are plenty of other projects out there
    using it so I'm sure the answer lies within somehow.


    Comment

    • Nicolas

      #3
      Re: Newsletter script in PHP

      > Have you looked at using phpMailer? It's a very good mail handling class
      for[color=blue]
      > PHP that's completely free but has a lot of built-in functionality for
      > handling large quantities of mail.[/color]

      I'll try it, to see how fast it can be...

      Thanks

      Nicolas


      Comment

      • furry

        #4
        Re: Newsletter script in PHP

        Also, when you're using php's mail function or phpmailer, it is preferable
        (from a speed perspective) to call the sent function once with a big to-list
        rather than call the send function multiple times within a loop.

        Doing the latter will open and close your connection to the mail server
        slowing things down considerably.

        Doing it once will mean that you lose the personalisation options (Dear
        $Firstname $Lastname), but I guess this might be acceptable is your
        preference is for speed.

        Also, for phpmailer (which I also highly recommend), see the performance
        questions in the FAQ here for more tips:



        "Nicolas" <nicolasNO@SPAM lomitko.com> wrote in message
        news:bovn53$1vs 8$1@biggoron.ne rim.net...[color=blue]
        > Have you looked at using phpMailer? It's a very good mail handling class[/color]
        for[color=blue]
        > PHP that's completely free but has a lot of built-in functionality for
        > handling large quantities of mail.[/color]

        I'll try it, to see how fast it can be...

        Thanks

        Nicolas



        Comment

        • Nicolas

          #5
          Re: Newsletter script in PHP

          > Also, when you're using php's mail function or phpmailer, it is preferable[color=blue]
          > (from a speed perspective) to call the sent function once with a big[/color]
          to-list[color=blue]
          > rather than call the send function multiple times within a loop.[/color]

          I considered this solution (with bcc instead of to) but I need some
          personalisation (see below).


          [color=blue]
          > Doing the latter will open and close your connection to the mail server
          > slowing things down considerably.
          >
          > Doing it once will mean that you lose the personalisation options (Dear
          > $Firstname $Lastname), but I guess this might be acceptable is your
          > preference is for speed.[/color]

          Actually, I don't need personalisation s like dear $firstname $lastname, but
          in my application, each subscriber gets an id and a key which allows him to
          unsubscribe from the newsletter. And I need to send that key with the
          newsletter in order to know that the user asking to unsubscribe is really
          himself.

          Otherwise he would send an unsubscribe request, receive a mail to confirm,
          and then be unsubuscribed when the application received the confirmation,
          which is a little heavy.


          [color=blue]
          > Also, for phpmailer (which I also highly recommend), see the performance
          > questions in the FAQ here for more tips:
          > http://phpmailer.sourceforge.net/faq.html#faq4[/color]

          I'll have a look at that link

          Thanks a lot

          Nicolas


          Comment

          • Manuel Lemos

            #6
            Re: Newsletter script in PHP

            Hello,

            On 11/13/2003 07:47 AM, Nicolas wrote:[color=blue]
            > I have programmed an application to manage newsletters in PHP. I send the
            > mails using smtp, but when there are more than 500 subscribers and when the
            > mails (in html) are too big, it is really slow.
            >
            > What can I do gain speed ?[/color]

            Sending mailings via SMTP is the slowest method of all because you need
            to establish an TCP connection with a relay server which just injects
            the messages in the queue to be resent again.

            If you have a local mailer in your machine like
            sendmail/qmail/postfix/etc... it is better to invoke the local mailer
            program which is just what the mail() function does under Linux/Unix.

            Depending on the type of local mailer that you use, you can try to
            optimize the queue injection further for mass mailing, using the right
            switches.

            In that case you may want to try this class for composing and sending
            messages that comes with sub-classes specialized in the delivery of
            messages with different local mailers.

            The class also makes it easy to compose messages in HTML properly
            according to the RFC recommendations . If your message bodies do need to
            be personalized for each user, the class can optimize the message
            composing further.



            --

            Regards,
            Manuel Lemos

            Free ready to use OOP components written in PHP
            Free PHP Classes and Objects 2025 Versions with PHP Example Scripts, PHP Tutorials, Download PHP Scripts, PHP articles, Remote PHP Jobs, Hire PHP Developers, PHP Book Reviews, PHP Language OOP Materials


            Comment

            • Manuel Lemos

              #7
              Re: Newsletter script in PHP

              Hello,

              On 11/13/2003 07:47 AM, Nicolas wrote:[color=blue]
              > I have programmed an application to manage newsletters in PHP. I send the
              > mails using smtp, but when there are more than 500 subscribers and when the
              > mails (in html) are too big, it is really slow.
              >
              > What can I do gain speed ?[/color]

              Sending mailings via SMTP is the slowest method of all because you need
              to establish an TCP connection with a relay server which just injects
              the messages in the queue to be resent again.

              If you have a local mailer in your machine like
              sendmail/qmail/postfix/etc... it is better to invoke the local mailer
              program which is just what the mail() function does under Linux/Unix.

              Depending on the type of local mailer that you use, you can try to
              optimize the queue injection further for mass mailing, using the right
              switches.

              In that case you may want to try this class for composing and sending
              messages that comes with sub-classes specialized in the delivery of
              messages with different local mailers.

              The class also makes it easy to compose messages in HTML properly
              according to the RFC recommendations . If your message bodies do need to
              be personalized for each user, the class can optimize the message
              composing further.



              --

              Regards,
              Manuel Lemos

              Free ready to use OOP components written in PHP
              Free PHP Classes and Objects 2025 Versions with PHP Example Scripts, PHP Tutorials, Download PHP Scripts, PHP articles, Remote PHP Jobs, Hire PHP Developers, PHP Book Reviews, PHP Language OOP Materials


              Comment

              Working...