php mailing list operation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cleverbum@hotmail.com

    php mailing list operation

    Hi,
    I'm using the mail() function to send out newsletters to subscribers,
    problem is that it seems a little unreliable...
    at the moment I assemble the mail outside a loop then iterate through
    all the mail addresses
    for($i=0;$i<$nu maddresses;$i++ ){
    mail($to[$i],$subj,$message ,$fromstr);
    }
    should i be putting in a delay message or a retry_on_fail method or
    anything?

    Martin

  • Carl Vondrick

    #2
    Re: php mailing list operation

    Cleverbum@hotma il.com wrote:[color=blue]
    > Hi,
    > I'm using the mail() function to send out newsletters to subscribers,
    > problem is that it seems a little unreliable...
    > at the moment I assemble the mail outside a loop then iterate through
    > all the mail addresses
    > for($i=0;$i<$nu maddresses;$i++ ){
    > mail($to[$i],$subj,$message ,$fromstr);
    > }
    > should i be putting in a delay message or a retry_on_fail method or
    > anything?
    >
    > Martin
    >[/color]

    mail() is not usually the best choice - you should try using sendmail or
    STMP.

    But, anyways, for mail, you should batch them. I send 50 at a time. If
    you do not, your script will either time out or your browser will abort.

    Carl Vondrick

    Comment

    • Richard Levasseur

      #3
      Re: php mailing list operation

      I've had a similar question myself.
      I don't want the email to contain a long To: or CC:, but I don't want
      to loop a bunch because sometimes mail() takes forever to send.

      Is there a way to simply queue them up and let the mailer daemon
      process them at its leisure, so the mail() command returns nice and
      quick?

      I know you wouldn't have any useful information returned as to whether
      it mailed or not, but I'm not worried about that.

      -Richard Levasseur

      Comment

      • Carl Vondrick

        #4
        Re: php mailing list operation

        Richard Levasseur wrote:[color=blue]
        > I've had a similar question myself.
        > I don't want the email to contain a long To: or CC:, but I don't want
        > to loop a bunch because sometimes mail() takes forever to send.[/color]

        I am by no means a mail expert, but the way I just do it is batch them.
        With a little bit of Ajax, the thing is seamless.
        [color=blue]
        >
        > Is there a way to simply queue them up and let the mailer daemon
        > process them at its leisure, so the mail() command returns nice and
        > quick?
        >
        > I know you wouldn't have any useful information returned as to whether
        > it mailed or not, but I'm not worried about that.
        >
        > -Richard Levasseur
        >[/color]


        --
        Carl Vondrick
        Professor of Computer Science at Columbia University, researching computer vision, machine learning, and AI applications.

        usenet [at] carlsoft [dot] net

        Comment

        • Manuel Lemos

          #5
          Re: php mailing list operation

          Hello,

          on 02/27/2006 11:44 PM Richard Levasseur said the following:[color=blue]
          > I've had a similar question myself.
          > I don't want the email to contain a long To: or CC:, but I don't want
          > to loop a bunch because sometimes mail() takes forever to send.
          >
          > Is there a way to simply queue them up and let the mailer daemon
          > process them at its leisure, so the mail() command returns nice and
          > quick?[/color]

          Yes, some MTA provide means to just queue the message and do not wait
          for delivery attempt.

          Under Linux/Unix, sendmail and exim have switches for this. Under
          Windows you can drop the messages in Exchange pickup folder .

          If you want to go for these solutions, you may want to try this class.
          It has sub-classes specialized in deliverying with different MTA:
          sendmail (or exim, or postfix), qmail, SMTP, Exchange pickup folder,
          etc.. Just call the class SetBulkMail function before entering the bulk
          mail loop.



          PS. Do not use SMTP for bulk mailing unless you do not have an
          alternative. It is the slowest method of all.


          --

          Regards,
          Manuel Lemos

          Metastorage - Data object relational mapping layer generator


          PHP Classes - Free ready to use OOP components written in PHP
          Free PHP Classes and Objects 2026 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...