Mail trouble

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

    Mail trouble

    I believe this question has been asked before, but I haven't found the
    solution to it.

    I've given up on the php mail() function (doesn't work fast enough for
    sending large amounts of HTML mails).

    Instead, I'd like to throw all my mails into the mail queue. I'm running
    sendmail on freeBSD and imagine that I should be able to use the exec()
    command.

    Anyone has an idea?

    Thanks in advance.

    --
    bonfils



  • CountScubula

    #2
    Re: Mail trouble

    "bonfils" <kim@bonfils.yo ur.underwear.co m> wrote in message
    news:3ffebaf1$0 $27409$edfadb0f @dread16.news.t ele.dk...[color=blue]
    > I believe this question has been asked before, but I haven't found the
    > solution to it.
    >
    > I've given up on the php mail() function (doesn't work fast enough for
    > sending large amounts of HTML mails).
    >
    > Instead, I'd like to throw all my mails into the mail queue. I'm running
    > sendmail on freeBSD and imagine that I should be able to use the exec()
    > command.
    >
    > Anyone has an idea?
    >
    > Thanks in advance.
    >
    > --
    > bonfils
    > http://kim.bonfils.com
    >
    >[/color]

    I have serveral idea, each differnt depeing on your needs, how many emails
    are you trying to send?


    --
    Mike Bradley
    http://www.gzentools.com -- free online php tools


    Comment

    • bonfils

      #3
      Re: Mail trouble

      "CountScubu la" <me@scantek.hot mail.com> wrote:
      [color=blue]
      > I have serveral idea, each differnt depeing on your needs, how many emails
      > are you trying to send?[/color]

      Currently just over a thousand - but of course it would be nice if I didn't
      have to worry about the amount.
      The script runs fine using the mail() function on plain text emails - it's
      HTML emails (around 20 KB) that makes the mail server malfunction.

      --
      bonfils.



      Comment

      • CountScubula

        #4
        Re: Mail trouble

        One of the things I do is to add a user to the mail server and in the
        /home/username/ directory, create a file called .forward and put all the
        email addresses in there. Then simple send an email to the user you just
        added, the server will forward it to everyone on that list.

        --
        Mike Bradley
        http://www.gzentools.com -- free online php tools
        "bonfils" <kim@bonfils.my .underwear.com> wrote in message
        news:3fffcdd4$0 $29405$edfadb0f @dread15.news.t ele.dk...[color=blue]
        > "CountScubu la" <me@scantek.hot mail.com> wrote:
        >[color=green]
        > > I have serveral idea, each differnt depeing on your needs, how many[/color][/color]
        emails[color=blue][color=green]
        > > are you trying to send?[/color]
        >
        > Currently just over a thousand - but of course it would be nice if I[/color]
        didn't[color=blue]
        > have to worry about the amount.
        > The script runs fine using the mail() function on plain text emails - it's
        > HTML emails (around 20 KB) that makes the mail server malfunction.
        >
        > --
        > bonfils.
        > http://kim.bonfils.com
        >
        >[/color]


        Comment

        • Manuel Lemos

          #5
          Re: Mail trouble

          Hello,

          On 01/09/2004 12:28 PM, bonfils wrote:[color=blue]
          > I believe this question has been asked before, but I haven't found the
          > solution to it.
          >
          > I've given up on the php mail() function (doesn't work fast enough for
          > sending large amounts of HTML mails).
          >
          > Instead, I'd like to throw all my mails into the mail queue. I'm running
          > sendmail on freeBSD and imagine that I should be able to use the exec()
          > command.
          >
          > Anyone has an idea?[/color]

          If you are under Unix/Linux, your problem is most likely that you are
          configuring your MTA to try to send messages immediately as opposed to
          queue the message for later delivery.

          In that case, if you are using sendmail in your server, it would be
          better to switch for instance to qmail, but if you can't there are
          options to instruct sendmail to defer deliveries until once your queue
          is run to process your pending deliveries. This results in much faster
          queueing.

          You may want to take a look at this class for composing and sending
          messages that comes with a sub-class specialized in delivering with
          sendmail and has options to tell sendmail to defer your message deliveries.




          --

          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

          • bonfils

            #6
            Re: Mail trouble

            "bonfils" <kim@bonfils.yo ur.underwear.co m> wrote:
            [color=blue]
            > I believe this question has been asked before, but I haven't found the
            > solution to it.
            >
            > I've given up on the php mail() function (doesn't work fast enough for
            > sending large amounts of HTML mails).
            >
            > Instead, I'd like to throw all my mails into the mail queue. I'm running
            > sendmail on freeBSD and imagine that I should be able to use the exec()
            > command.
            >
            > Anyone has an idea?[/color]

            First of all: Thanks for your input. You've been very helpful.
            However, I haven't had any luck yet.
            My latest thought is this: Could this be achieved using the mail() function
            and just changing the sendmail_path line in my php.ini file so that it sends
            all mails to the queue?
            However:

            sendmail_path = /usr/sbin/sendmail -odq

            doesn't work. The path is correct (it's FreeBSD), but the line above just
            makes the mails disappear (not to the queue...)

            Any ideas?

            --
            bonfils



            Comment

            • Ian.H

              #7
              Re: Mail trouble

              On Mon, 12 Jan 2004 16:11:42 +0100, bonfils wrote:
              [color=blue][color=green]
              >> Instead, I'd like to throw all my mails into the mail queue. I'm running
              >> sendmail on freeBSD and imagine that I should be able to use the exec()
              >> command.
              >>
              >> Anyone has an idea?[/color]
              >
              > First of all: Thanks for your input. You've been very helpful. However, I
              > haven't had any luck yet.
              > My latest thought is this: Could this be achieved using the mail()
              > function and just changing the sendmail_path line in my php.ini file so
              > that it sends all mails to the queue?
              > However:
              >
              > sendmail_path = /usr/sbin/sendmail -odq
              >
              > doesn't work. The path is correct (it's FreeBSD), but the line above just
              > makes the mails disappear (not to the queue...)
              >
              > Any ideas?[/color]


              While I don't particularly like the sound if this "it doesn't send batches
              of HTML mail fast enough" (do I smell pork?).. mail() uses sendmail and
              also uses the params you define in php.ini so changing that has no actual
              input in the way you're after. If you want to use sendmail direct then you
              need to feed sendmail itself. As you're on FBSD, try:


              $ perldoc -q "How do I send mail?"


              Yes it's Perl.. but it's the same method you'd use in PHP to
              send mail to sendmail directly.

              I'll leave the porting from Perl to PHP as an educational exercise.



              Regards,

              Ian

              --
              Ian.H [Design & Development]
              digiServ Network - Web solutions
              www.digiserv.net | irc.digiserv.ne t | forum.digiserv. net
              Programming, Web design, development & hosting.

              Comment

              • CountScubula

                #8
                Re: Mail trouble

                ok, here is another wacky solution.

                write a small script that reads a text file of emails, and uses mail to send
                them

                the from your main script do this:

                `php -q mailscript.php addys.txt &`;

                this will cause the mailscript.php to run in the background.

                --
                Mike Bradley
                http://www.gzentools.com -- free online php tools
                "bonfils" <kim@bonfils.yo ur.underwear.co m> wrote in message
                news:3ffebaf1$0 $27409$edfadb0f @dread16.news.t ele.dk...[color=blue]
                > I believe this question has been asked before, but I haven't found the
                > solution to it.
                >
                > I've given up on the php mail() function (doesn't work fast enough for
                > sending large amounts of HTML mails).
                >
                > Instead, I'd like to throw all my mails into the mail queue. I'm running
                > sendmail on freeBSD and imagine that I should be able to use the exec()
                > command.
                >
                > Anyone has an idea?
                >
                > Thanks in advance.
                >
                > --
                > bonfils
                > http://kim.bonfils.com
                >
                >[/color]


                Comment

                • bonfils

                  #9
                  Re: Mail trouble

                  "CountScubu la" <me@scantek.hot mail.com> wrote:
                  [color=blue]
                  > ok, here is another wacky solution.
                  >
                  > write a small script that reads a text file of emails, and uses mail to[/color]
                  send[color=blue]
                  > them
                  >
                  > the from your main script do this:
                  >
                  > `php -q mailscript.php addys.txt &`;
                  >
                  > this will cause the mailscript.php to run in the background.[/color]

                  Looks cool. I'll just have to study a bit to find out what the command does.
                  (Especially the "&")
                  Problem is, I still have to generate every single email one at a time as it
                  includes a personal greeting and unsubscribe information. But having the
                  script run in the background makes sense.

                  --
                  bonfils



                  Comment

                  • CountScubula

                    #10
                    Re: Mail trouble

                    "bonfils" <kim@bonfils.yo ur.underwear.co m> wrote in message
                    news:4003abe5$0 $27359$edfadb0f @dread16.news.t ele.dk...[color=blue]
                    > "CountScubu la" <me@scantek.hot mail.com> wrote:
                    >[color=green]
                    > > ok, here is another wacky solution.
                    > >
                    > > write a small script that reads a text file of emails, and uses mail to[/color]
                    > send[color=green]
                    > > them
                    > >
                    > > the from your main script do this:
                    > >
                    > > `php -q mailscript.php addys.txt &`;
                    > >
                    > > this will cause the mailscript.php to run in the background.[/color]
                    >
                    > Looks cool. I'll just have to study a bit to find out what the command[/color]
                    does.[color=blue]
                    > (Especially the "&")
                    > Problem is, I still have to generate every single email one at a time as[/color]
                    it[color=blue]
                    > includes a personal greeting and unsubscribe information. But having the
                    > script run in the background makes sense.
                    >
                    > --
                    > bonfils
                    > http://kim.bonfils.com
                    >
                    >[/color]

                    the `` backticks : runs a shell command

                    php -q : just runs a script with no headers sent out

                    & : tells the shell to run this command in background

                    so,

                    `php -q scriptname.php addyfile.txt &`;

                    runs a shell command, php to run scriptname.php and pass the parameter
                    addyfile.txt, oh, and do this in the background.

                    --
                    Mike Bradley
                    http://www.gzentools.com -- free online php tools


                    Comment

                    • bonfils

                      #11
                      Re: Mail trouble

                      "CountScubu la" <me@scantek.hot mail.com> wrote:
                      [color=blue]
                      > the `` backticks : runs a shell command
                      >
                      > php -q : just runs a script with no headers sent out
                      >
                      > & : tells the shell to run this command in background
                      >
                      > so,
                      >
                      > `php -q scriptname.php addyfile.txt &`;
                      >
                      > runs a shell command, php to run scriptname.php and pass the parameter
                      > addyfile.txt, oh, and do this in the background.[/color]

                      Thanks.

                      ;-)

                      --
                      bonfils



                      Comment

                      • Geoff Berrow

                        #12
                        Re: Mail trouble

                        I noticed that Message-ID:
                        <MuQLb.2342$bw3 .944@newssvr29. news.prodigy.co m> from CountScubula
                        contained the following:
                        [color=blue]
                        >One of the things I do is to add a user to the mail server and in the
                        >/home/username/ directory, create a file called .forward and put all the
                        >email addresses in there. Then simple send an email to the user you just
                        >added, the server will forward it to everyone on that list.[/color]

                        Not much use if you want to customise the mail though.

                        --
                        Geoff Berrow (put thecat out to email)
                        It's only Usenet, no one dies.
                        My opinions, not the committee's, mine.
                        Simple RFDs http://www.ckdog.co.uk/rfdmaker/

                        Comment

                        • CountScubula

                          #13
                          Re: Mail trouble

                          "Geoff Berrow" <blthecat@ckdog .co.uk> wrote in message
                          news:1cu800h1or 8tjv55vipemnoij oru6sl2q9@4ax.c om...[color=blue]
                          > I noticed that Message-ID:
                          > <MuQLb.2342$bw3 .944@newssvr29. news.prodigy.co m> from CountScubula
                          > contained the following:
                          >[color=green]
                          > >One of the things I do is to add a user to the mail server and in the
                          > >/home/username/ directory, create a file called .forward and put all the
                          > >email addresses in there. Then simple send an email to the user you just
                          > >added, the server will forward it to everyone on that list.[/color]
                          >
                          > Not much use if you want to customise the mail though.
                          >
                          > --
                          > Geoff Berrow (put thecat out to email)
                          > It's only Usenet, no one dies.
                          > My opinions, not the committee's, mine.
                          > Simple RFDs http://www.ckdog.co.uk/rfdmaker/[/color]

                          This is tru, thats why its simple solution, not a complex, customize to your
                          needs type of solution

                          --
                          Mike Bradley
                          http://www.gzentools.com -- free online php tools


                          Comment

                          Working...