Why PHP Mail Not Sent

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

    Why PHP Mail Not Sent

    Hello,

    Is there any way to determine why a PHP mail message is not delivered? I
    have a particular user who is not receiving mail from my PHP application and
    I don't know why, it just totally disappears. Using the following test did
    not work either.


    $to = 'gladys@herwebs ite.com';
    $subject = 'Wakeup Gladys!';
    $message = '<b>yo</b>, whassup?';
    $headers = "From: vic@mywebsite.c om\r\n" .
    'X-Mailer: PHP/' . phpversion() . "\r\n" .
    "MIME-Version: 1.0\r\n" .
    "Content-Type: text/html; charset=utf-8\r\n" .
    "Content-Transfer-Encoding: 8bit\r\n\r\n";


    Thanks for any help received!

    Vic


  • Andy Hassall

    #2
    Re: Why PHP Mail Not Sent

    On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vic@showsec.co m> wrote:
    [color=blue]
    >Is there any way to determine why a PHP mail message is not delivered? I
    >have a particular user who is not receiving mail from my PHP application and
    >I don't know why, it just totally disappears. Using the following test did
    >not work either.
    >
    > $to = 'gladys@herwebs ite.com';
    > $subject = 'Wakeup Gladys!';
    > $message = '<b>yo</b>, whassup?';
    > $headers = "From: vic@mywebsite.c om\r\n" .
    > 'X-Mailer: PHP/' . phpversion() . "\r\n" .
    > "MIME-Version: 1.0\r\n" .
    > "Content-Type: text/html; charset=utf-8\r\n" .
    > "Content-Transfer-Encoding: 8bit\r\n\r\n";[/color]

    Presumably there's a call to mail() as well ;-)

    How much access to mailserver logs on both sides do you have? First place I'd
    look is /var/log/maillog (or equivalent) at least on the sending system to make
    sure it's going out, and then on the receiving end to see if it arrived but was
    subsequently zapped by spam filters.

    --
    Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
    http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

    Comment

    • Vic Spainhower

      #3
      Re: Why PHP Mail Not Sent

      Andy,

      oops - yes I am making a call to the mail function:

      $success = mail($to, $subject, $message, $headers);

      Now, this is running on a Windows Host so would the mail logs be created
      automatically and would I need to check with the ISP as to the location or
      is this defined in the php.ini file?

      Vic



      "Andy Hassall" <andy@andyh.co. uk> wrote in message
      news:o5egs19bk7 gu3qj245ha3f8kn 3om0iid7h@4ax.c om...[color=blue]
      > On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vic@showsec.co m>
      > wrote:
      >[color=green]
      >>Is there any way to determine why a PHP mail message is not delivered? I
      >>have a particular user who is not receiving mail from my PHP application
      >>and
      >>I don't know why, it just totally disappears. Using the following test did
      >>not work either.
      >>
      >> $to = 'gladys@herwebs ite.com';
      >> $subject = 'Wakeup Gladys!';
      >> $message = '<b>yo</b>, whassup?';
      >> $headers = "From: vic@mywebsite.c om\r\n" .
      >> 'X-Mailer: PHP/' . phpversion() . "\r\n" .
      >> "MIME-Version: 1.0\r\n" .
      >> "Content-Type: text/html; charset=utf-8\r\n" .
      >> "Content-Transfer-Encoding: 8bit\r\n\r\n";[/color]
      >
      > Presumably there's a call to mail() as well ;-)
      >
      > How much access to mailserver logs on both sides do you have? First place
      > I'd
      > look is /var/log/maillog (or equivalent) at least on the sending system to
      > make
      > sure it's going out, and then on the receiving end to see if it arrived
      > but was
      > subsequently zapped by spam filters.
      >
      > --
      > Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
      > http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool[/color]


      Comment

      • Andy Hassall

        #4
        Re: Why PHP Mail Not Sent

        On Fri, 13 Jan 2006 15:45:51 -0800, "Vic Spainhower" <vic@showsec.co m> wrote:
        [color=blue]
        >Now, this is running on a Windows Host so would the mail logs be created
        >automaticall y and would I need to check with the ISP as to the location or
        >is this defined in the php.ini file?[/color]

        You'd need to check with the ISP. It's not to do with PHP, I'm thinking of the
        logs that the mail server itself generates (at least on UNIX-based systems).

        --
        Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
        http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

        Comment

        • Jim Michaels

          #5
          Re: Why PHP Mail Not Sent

          I noticed that my web mail on yahoo will filter out emails sent from PHP
          into the Bulk Mail folder automatially. I've tried everything to fx that,
          even setting the Return-Path:, but the resulting email had a different
          Return-Path than what I set. I think the mail server mangled it. I don't
          think it was PHP because PHP doesn't have a setting for that.

          "Andy Hassall" <andy@andyh.co. uk> wrote in message
          news:o5egs19bk7 gu3qj245ha3f8kn 3om0iid7h@4ax.c om...[color=blue]
          > On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vic@showsec.co m>
          > wrote:
          >[color=green]
          >>Is there any way to determine why a PHP mail message is not delivered? I
          >>have a particular user who is not receiving mail from my PHP application
          >>and
          >>I don't know why, it just totally disappears. Using the following test did
          >>not work either.
          >>
          >> $to = 'gladys@herwebs ite.com';
          >> $subject = 'Wakeup Gladys!';
          >> $message = '<b>yo</b>, whassup?';
          >> $headers = "From: vic@mywebsite.c om\r\n" .
          >> 'X-Mailer: PHP/' . phpversion() . "\r\n" .
          >> "MIME-Version: 1.0\r\n" .
          >> "Content-Type: text/html; charset=utf-8\r\n" .
          >> "Content-Transfer-Encoding: 8bit\r\n\r\n";[/color]
          >
          > Presumably there's a call to mail() as well ;-)
          >
          > How much access to mailserver logs on both sides do you have? First place
          > I'd
          > look is /var/log/maillog (or equivalent) at least on the sending system to
          > make
          > sure it's going out, and then on the receiving end to see if it arrived
          > but was
          > subsequently zapped by spam filters.
          >
          > --
          > Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
          > http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool[/color]


          Comment

          • Philip Ronan

            #6
            Re: Why PHP Mail Not Sent

            Vic Spainhower wrote:
            [color=blue]
            > Hello,
            >
            > Is there any way to determine why a PHP mail message is not delivered? I
            > have a particular user who is not receiving mail from my PHP application and
            > I don't know why, it just totally disappears. Using the following test did
            > not work either.
            >
            >
            > $to = 'gladys@herwebs ite.com';
            > $subject = 'Wakeup Gladys!';
            > $message = '<b>yo</b>, whassup?';
            > $headers = "From: vic@mywebsite.c om\r\n" .
            > 'X-Mailer: PHP/' . phpversion() . "\r\n" .
            > "MIME-Version: 1.0\r\n" .
            > "Content-Type: text/html; charset=utf-8\r\n" .
            > "Content-Transfer-Encoding: 8bit\r\n\r\n";[/color]

            The mail is quite possibly being blackholed by a spam filter because you're
            using "\r\n" to separate the mail headers. Use "\n" instead. I know that's
            not what it says in RFC822, but that's just how things turned out.

            Sending HTML content without any <HTML> tag at the beginning might set a few
            alarm bells ringing too. In general you'll have fewer problems if you emulate
            the behaviour of regular email software.

            Phil

            --
            philronan [@] blueyonder [dot] co [dot] uk

            Comment

            • Vic Spainhower

              #7
              Re: Why PHP Mail Not Sent

              Phil,

              I tried removing the \r but it doesn't help, message still is never
              delivered. remains a mystery

              Vic


              "Philip Ronan" <nobody@example .invalid> wrote in message
              news:0001HW.BFE FEF770079E2D1F0 68C550@news.blu eyonder.co.uk.. .[color=blue]
              > Vic Spainhower wrote:
              >[color=green]
              >> Hello,
              >>
              >> Is there any way to determine why a PHP mail message is not delivered? I
              >> have a particular user who is not receiving mail from my PHP application
              >> and
              >> I don't know why, it just totally disappears. Using the following test
              >> did
              >> not work either.
              >>
              >>
              >> $to = 'gladys@herwebs ite.com';
              >> $subject = 'Wakeup Gladys!';
              >> $message = '<b>yo</b>, whassup?';
              >> $headers = "From: vic@mywebsite.c om\r\n" .
              >> 'X-Mailer: PHP/' . phpversion() . "\r\n" .
              >> "MIME-Version: 1.0\r\n" .
              >> "Content-Type: text/html; charset=utf-8\r\n" .
              >> "Content-Transfer-Encoding: 8bit\r\n\r\n";[/color]
              >
              > The mail is quite possibly being blackholed by a spam filter because
              > you're
              > using "\r\n" to separate the mail headers. Use "\n" instead. I know that's
              > not what it says in RFC822, but that's just how things turned out.
              >
              > Sending HTML content without any <HTML> tag at the beginning might set a
              > few
              > alarm bells ringing too. In general you'll have fewer problems if you
              > emulate
              > the behaviour of regular email software.
              >
              > Phil
              >
              > --
              > philronan [@] blueyonder [dot] co [dot] uk
              >[/color]


              Comment

              • Philip Ronan

                #8
                Re: Why PHP Mail Not Sent

                Vic Spainhower wrote:
                [color=blue]
                > Phil,
                >
                > I tried removing the \r but it doesn't help, message still is never
                > delivered. remains a mystery
                >
                > Vic[/color]

                Bummer :-(

                Try sending to a different address, preferably a mailbox you can access
                directly before any spam filtering takes place. If it doesn't get through,
                then maybe your server isn't configured properly. If it does get through then
                post the headers here so we can have a look (not forgetting to obscure the
                email addresses first!).

                If your headers are OK and you can send mail to other domains then perhaps
                you've been blacklisted for some other reason. Are you emailing from a
                virtually hosted site? When you share a server with 500 other websites,
                there's a good chance one of them is sending out spam and getting the server
                blacklisted. Tiy can check this by running a spam database lookup at
                <http://www.dnsstuff.co m/> -- just enter your server's IP address and see
                what comes back.

                --
                philronan [@] blueyonder [dot] co [dot] uk

                Comment

                • Vic Spainhower

                  #9
                  Re: Why PHP Mail Not Sent

                  Hi Phil,

                  I checked the www.dnsstuff.com and the server is not listed. Here are the
                  headers from the message. I receive the message but Gladys doe not.

                  Received: from web78.expresste ch.net ([199.231.134.14])
                  by email10.mywebma ilserver.com (IntelliMail) with ESMTP id CRY74585
                  for <vic at dhowsec dot com>; Mon, 16 Jan 2006 09:35:41 -0500
                  Received: from web78 ([127.0.0.1]) by web78.expresste ch.net with Microsoft
                  SMTPSVC(6.0.379 0.211);
                  Mon, 16 Jan 2006 09:35:21 -0500
                  Date: Mon, 16 Jan 2006 09:35:21 -0500
                  Subject: Horse Show entry for ShowMyHorse (Demo Show) ...
                  To: vic at showsec dot com, gladys at oaksshowservice s dot com
                  From: webmaster at showmyhorse dot com
                  Content-type: text/plain
                  x-mailer: PHP/4.3.10
                  Return-Path: me@localhost.co m
                  Message-ID: <WEB78SeHqwEsX5 xyNYh0000feaa@w eb78.expresstec h.net>
                  X-OriginalArrival Time: 16 Jan 2006 14:35:21.0359 (UTC)
                  FILETIME=[1446E1F0:01C61A AA]

                  Appreciate your help in this ...

                  Vic



                  Comment

                  • Gordon Burditt

                    #10
                    Re: Why PHP Mail Not Sent

                    >I checked the www.dnsstuff.com and the server is not listed. Here are the[color=blue]
                    >headers from the message. I receive the message but Gladys doe not.[/color]

                    Reasons or dropping this message, used by a lot of servers:
                    1. The From: line does not contain a valid email address.
                    2. The To: line contains RFC822 syntax errors
                    3. The Return-path resolves to an MX server with a private IP address.
                    [color=blue]
                    >
                    >Received: from web78.expresste ch.net ([199.231.134.14])
                    > by email10.mywebma ilserver.com (IntelliMail) with ESMTP id CRY74585
                    > for <vic at dhowsec dot com>; Mon, 16 Jan 2006 09:35:41 -0500
                    >Received: from web78 ([127.0.0.1]) by web78.expresste ch.net with Microsoft
                    >SMTPSVC(6.0.37 90.211);
                    > Mon, 16 Jan 2006 09:35:21 -0500
                    >Date: Mon, 16 Jan 2006 09:35:21 -0500
                    >Subject: Horse Show entry for ShowMyHorse (Demo Show) ...
                    >To: vic at showsec dot com, gladys at oaksshowservice s dot com
                    >From: webmaster at showmyhorse dot com
                    >Content-type: text/plain
                    > x-mailer: PHP/4.3.10
                    >Return-Path: me@localhost.co m
                    >Message-ID: <WEB78SeHqwEsX5 xyNYh0000feaa@w eb78.expresstec h.net>
                    >X-OriginalArrival Time: 16 Jan 2006 14:35:21.0359 (UTC)
                    >FILETIME=[1446E1F0:01C61A AA]
                    >
                    >Appreciate your help in this ...
                    >
                    >Vic[/color]

                    Gordon L. Burditt

                    Comment

                    • Vic Spainhower

                      #11
                      Re: Why PHP Mail Not Sent

                      Jim,

                      I was able to set the return path in the message header and it does come
                      through OK. However, it didn't fix the problem with this particular address.

                      Vic


                      "Jim Michaels" <jmichae3@yahoo .com> wrote in message
                      news:pK-dnUgmbM-bgFfenZ2dnUVZ_t adnZ2d@comcast. com...[color=blue]
                      >I noticed that my web mail on yahoo will filter out emails sent from PHP
                      >into the Bulk Mail folder automatially. I've tried everything to fx that,
                      >even setting the Return-Path:, but the resulting email had a different
                      >Return-Path than what I set. I think the mail server mangled it. I don't
                      >think it was PHP because PHP doesn't have a setting for that.
                      >
                      > "Andy Hassall" <andy@andyh.co. uk> wrote in message
                      > news:o5egs19bk7 gu3qj245ha3f8kn 3om0iid7h@4ax.c om...[color=green]
                      >> On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vic@showsec.co m>
                      >> wrote:
                      >>[color=darkred]
                      >>>Is there any way to determine why a PHP mail message is not delivered? I
                      >>>have a particular user who is not receiving mail from my PHP application
                      >>>and
                      >>>I don't know why, it just totally disappears. Using the following test
                      >>>did
                      >>>not work either.
                      >>>
                      >>> $to = 'gladys@herwebs ite.com';
                      >>> $subject = 'Wakeup Gladys!';
                      >>> $message = '<b>yo</b>, whassup?';
                      >>> $headers = "From: vic@mywebsite.c om\r\n" .
                      >>> 'X-Mailer: PHP/' . phpversion() . "\r\n" .
                      >>> "MIME-Version: 1.0\r\n" .
                      >>> "Content-Type: text/html; charset=utf-8\r\n" .
                      >>> "Content-Transfer-Encoding: 8bit\r\n\r\n";[/color]
                      >>
                      >> Presumably there's a call to mail() as well ;-)
                      >>
                      >> How much access to mailserver logs on both sides do you have? First place
                      >> I'd
                      >> look is /var/log/maillog (or equivalent) at least on the sending system
                      >> to make
                      >> sure it's going out, and then on the receiving end to see if it arrived
                      >> but was
                      >> subsequently zapped by spam filters.
                      >>
                      >> --
                      >> Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
                      >> http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool[/color]
                      >
                      >[/color]


                      Comment

                      • Vic Spainhower

                        #12
                        Re: Why PHP Mail Not Sent

                        Gordon -

                        I think SMTP must validate the To: line because I added a \n to the end of the line and received Warning: mail(): SMTP server response: 501 5.5.4 Invalid Address in d:\html\users\1 76666\showmyhor secom\html\Show Info_page.php on line 87

                        I also added a Return-Path with a valid email address and that didn't help either. I know the return-path was included in the headers because I checked my copy of the email and it was there.

                        Vic


                        "Gordon Burditt" <gordonb.slagc@ burditt.org> wrote in message news:11sniqfeh6 fk719@corp.supe rnews.com...[color=blue][color=green]
                        > >I checked the www.dnsstuff.com and the server is not listed. Here are the
                        >>headers from the message. I receive the message but Gladys doe not.[/color]
                        >
                        > Reasons or dropping this message, used by a lot of servers:
                        > 1. The From: line does not contain a valid email address.
                        > 2. The To: line contains RFC822 syntax errors
                        > 3. The Return-path resolves to an MX server with a private IP address.
                        > [color=green]
                        >>
                        >>Received: from web78.expresste ch.net ([199.231.134.14])
                        >> by email10.mywebma ilserver.com (IntelliMail) with ESMTP id CRY74585
                        >> for <vic at dhowsec dot com>; Mon, 16 Jan 2006 09:35:41 -0500
                        >>Received: from web78 ([127.0.0.1]) by web78.expresste ch.net with Microsoft
                        >>SMTPSVC(6.0.3 790.211);
                        >> Mon, 16 Jan 2006 09:35:21 -0500
                        >>Date: Mon, 16 Jan 2006 09:35:21 -0500
                        >>Subject: Horse Show entry for ShowMyHorse (Demo Show) ...
                        >>To: vic at showsec dot com, gladys at oaksshowservice s dot com
                        >>From: webmaster at showmyhorse dot com
                        >>Content-type: text/plain
                        >> x-mailer: PHP/4.3.10
                        >>Return-Path: me@localhost.co m
                        >>Message-ID: <WEB78SeHqwEsX5 xyNYh0000feaa@w eb78.expresstec h.net>
                        >>X-OriginalArrival Time: 16 Jan 2006 14:35:21.0359 (UTC)
                        >>FILETIME=[1446E1F0:01C61A AA]
                        >>
                        >>Appreciate your help in this ...
                        >>
                        >>Vic[/color]
                        >
                        > Gordon L. Burditt[/color]

                        Comment

                        • Jim Michaels

                          #13
                          Re: Why PHP Mail Not Sent

                          this was fixed by my hosting service. they set the sending email address to
                          an email address on the server I have set up. it *was* set up to some
                          address everybody was supposed to use.

                          "Jim Michaels" <jmichae3@yahoo .com> wrote in message
                          news:pK-dnUgmbM-bgFfenZ2dnUVZ_t adnZ2d@comcast. com...[color=blue]
                          >I noticed that my web mail on yahoo will filter out emails sent from PHP
                          >into the Bulk Mail folder automatially. I've tried everything to fx that,
                          >even setting the Return-Path:, but the resulting email had a different
                          >Return-Path than what I set. I think the mail server mangled it. I don't
                          >think it was PHP because PHP doesn't have a setting for that.
                          >
                          > "Andy Hassall" <andy@andyh.co. uk> wrote in message
                          > news:o5egs19bk7 gu3qj245ha3f8kn 3om0iid7h@4ax.c om...[color=green]
                          >> On Fri, 13 Jan 2006 15:19:01 -0800, "Vic Spainhower" <vic@showsec.co m>
                          >> wrote:
                          >>[color=darkred]
                          >>>Is there any way to determine why a PHP mail message is not delivered? I
                          >>>have a particular user who is not receiving mail from my PHP application
                          >>>and
                          >>>I don't know why, it just totally disappears. Using the following test
                          >>>did
                          >>>not work either.
                          >>>
                          >>> $to = 'gladys@herwebs ite.com';
                          >>> $subject = 'Wakeup Gladys!';
                          >>> $message = '<b>yo</b>, whassup?';
                          >>> $headers = "From: vic@mywebsite.c om\r\n" .
                          >>> 'X-Mailer: PHP/' . phpversion() . "\r\n" .
                          >>> "MIME-Version: 1.0\r\n" .
                          >>> "Content-Type: text/html; charset=utf-8\r\n" .
                          >>> "Content-Transfer-Encoding: 8bit\r\n\r\n";[/color]
                          >>
                          >> Presumably there's a call to mail() as well ;-)
                          >>
                          >> How much access to mailserver logs on both sides do you have? First place
                          >> I'd
                          >> look is /var/log/maillog (or equivalent) at least on the sending system
                          >> to make
                          >> sure it's going out, and then on the receiving end to see if it arrived
                          >> but was
                          >> subsequently zapped by spam filters.
                          >>
                          >> --
                          >> Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
                          >> http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool[/color]
                          >
                          >[/color]


                          Comment

                          Working...