mail() not reaching hotmail

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

    mail() not reaching hotmail

    Hello everyone,

    I am trying to use the mail() function to send a simple, text-only
    message. I have two websites hosted by the same company, on different
    servers. One is old and established, one I am currently developing.
    I am testing the mail functionality by sending a test message to an
    email account associated with my old website, and to my hotmail
    account. The message seems to be sent to both accounts, and I receive
    the message on my website's email account, but it never reaches my
    hotmail account.

    Are there any special headers required for hotmail? I've looked
    around a bit, and can't seem to figure it out. I've even tried
    including several different headers, but always with the same results
    - reaches my website's email account, but not my hotmail account. The
    code I am using to test is:

    <?php

    $body = 'Hello from the internet mail tubes!';
    $subject = 'Test message';
    $address = 'working_addres s@other_domain. com';
    $address2 = 'working_addres s@hotmail.com';
    $headers = "From: working_address @this_domain.co m";

    mail($address, $subject, $body, $headers) or print "Can not deliver
    to $address.";
    print "Done with $address.<br>";

    mail($address2, $subject, $body, $headers) or print "Can not deliver
    to $address2.";
    print "Done with $address2.<br>" ;

    ?>

  • Tom

    #2
    Re: mail() not reaching hotmail

    <e_matthes@hotm ail.comwrote in message
    news:1181061914 .124630.303680@ z28g2000prd.goo glegroups.com.. .
    Hello everyone,
    >
    I am trying to use the mail() function to send a simple, text-only
    message. I have two websites hosted by the same company, on different
    servers. One is old and established, one I am currently developing.
    I am testing the mail functionality by sending a test message to an
    email account associated with my old website, and to my hotmail
    account. The message seems to be sent to both accounts, and I receive
    the message on my website's email account, but it never reaches my
    hotmail account.
    >
    Are there any special headers required for hotmail? I've looked
    around a bit, and can't seem to figure it out. I've even tried
    including several different headers, but always with the same results
    - reaches my website's email account, but not my hotmail account. The
    code I am using to test is:
    >
    <?php
    >
    $body = 'Hello from the internet mail tubes!';
    $subject = 'Test message';
    $address = 'working_addres s@other_domain. com';
    $address2 = 'working_addres s@hotmail.com';
    $headers = "From: working_address @this_domain.co m";
    >
    mail($address, $subject, $body, $headers) or print "Can not deliver
    to $address.";
    print "Done with $address.<br>";
    >
    mail($address2, $subject, $body, $headers) or print "Can not deliver
    to $address2.";
    print "Done with $address2.<br>" ;
    >
    ?>
    >
    If you are really using that header, the "other_domain.c om" domain isn't
    showing up as a valid domain and most current mail systems will reject mail
    from bogus addresses.

    Tom
    --
    Newsguy.com
    90+ Days Retention
    99% Article Completion
    Can Now Create Your Own NZB Files


    Comment

    • e_matthes@hotmail.com

      #3
      Re: mail() not reaching hotmail

      On Jun 5, 8:53 am, "Tom" <t...@to.comwro te:
      <e_matt...@hotm ail.comwrote in message
      >
      news:1181061914 .124630.303680@ z28g2000prd.goo glegroups.com.. .
      >
      >
      >
      Hello everyone,
      >
      I am trying to use the mail() function to send a simple, text-only
      message. I have two websites hosted by the same company, on different
      servers. One is old and established, one I am currently developing.
      I am testing the mail functionality by sending a test message to an
      email account associated with my old website, and to my hotmail
      account. The message seems to be sent to both accounts, and I receive
      the message on my website's email account, but it never reaches my
      hotmail account.
      >
      Are there any special headers required for hotmail? I've looked
      around a bit, and can't seem to figure it out. I've even tried
      including several different headers, but always with the same results
      - reaches my website's email account, but not my hotmail account. The
      code I am using to test is:
      >
      <?php
      >
      $body = 'Hello from the internet mail tubes!';
      $subject = 'Test message';
      $address = 'working_addres s@other_domain. com';
      $address2 = 'working_addr.. .@hotmail.com';
      $headers = "From: working_address @this_domain.co m";
      >
      mail($address, $subject, $body, $headers) or print "Can not deliver
      to $address.";
      print "Done with $address.<br>";
      >
      mail($address2, $subject, $body, $headers) or print "Can not deliver
      to $address2.";
      print "Done with $address2.<br>" ;
      >
      ?>
      >
      If you are really using that header, the "other_domain.c om" domain isn't
      showing up as a valid domain and most current mail systems will reject mail
      from bogus addresses.
      >
      Tom
      --
      Newsguy.com
      90+ Days Retention
      99% Article Completion
      Can Now Create Your Own NZB Files
      Those are all working addresses, I just wrote dummy addresses for this
      posting:

      working_address @other_domain.c om - an address at my established site;
      working_address @hotmail.com - a working hotmail address;
      working_address @this_domain.co m - an address on the new site.

      Comment

      • Jon Slaughter

        #4
        Re: mail() not reaching hotmail


        <e_matthes@hotm ail.comwrote in message
        news:1181061914 .124630.303680@ z28g2000prd.goo glegroups.com.. .
        Hello everyone,
        >
        I am trying to use the mail() function to send a simple, text-only
        message. I have two websites hosted by the same company, on different
        servers. One is old and established, one I am currently developing.
        I am testing the mail functionality by sending a test message to an
        email account associated with my old website, and to my hotmail
        account. The message seems to be sent to both accounts, and I receive
        the message on my website's email account, but it never reaches my
        hotmail account.
        >
        Are there any special headers required for hotmail? I've looked
        around a bit, and can't seem to figure it out. I've even tried
        including several different headers, but always with the same results
        - reaches my website's email account, but not my hotmail account. The
        code I am using to test is:
        >
        <?php
        >
        $body = 'Hello from the internet mail tubes!';
        $subject = 'Test message';
        $address = 'working_addres s@other_domain. com';
        $address2 = 'working_addres s@hotmail.com';
        $headers = "From: working_address @this_domain.co m";
        >
        mail($address, $subject, $body, $headers) or print "Can not deliver
        to $address.";
        print "Done with $address.<br>";
        >
        mail($address2, $subject, $body, $headers) or print "Can not deliver
        to $address2.";
        print "Done with $address2.<br>" ;
        >
        ?>

        I think there are some issues with mail(). I'm not sure if thats your
        problem but I ran across a few bugs that it has when I was trying to figure
        out how to mail. They say the pear mail package is much better than this.

        The code I used for testing works fine for hotmail

        <?php
        echo "Sending Mail...<br/>\n";
        $to = 'testaddr@hotma il.com'; // changed
        $subject = 'test';
        $message = 'hello';
        $headers = 'From: webmaster@examp le.com' . "\r\n" . // Not changed... just
        crap addr but works
        'Reply-To: webmaster@examp le.com' . "\r\n" .
        'X-Mailer: PHP/' . phpversion();

        mail($to, $subject, $message, $headers) ? print "Sent mail!" : print "Cannot
        send mail";;
        ?>

        You might look at that and see the differences. (as you can see, it uses the
        "\r\n" and some extra info that you might see if it matters or not)



        Comment

        • e_matthes@hotmail.com

          #5
          Re: mail() not reaching hotmail

          On Jun 5, 9:52 am, "Jon Slaughter" <Jon_Slaugh...@ Hotmail.comwrot e:
          <e_matt...@hotm ail.comwrote in message
          >
          news:1181061914 .124630.303680@ z28g2000prd.goo glegroups.com.. .
          >
          >
          >
          Hello everyone,
          >
          I am trying to use the mail() function to send a simple, text-only
          message. I have two websites hosted by the same company, on different
          servers. One is old and established, one I am currently developing.
          I am testing the mail functionality by sending a test message to an
          email account associated with my old website, and to my hotmail
          account. The message seems to be sent to both accounts, and I receive
          the message on my website's email account, but it never reaches my
          hotmail account.
          >
          Are there any special headers required for hotmail? I've looked
          around a bit, and can't seem to figure it out. I've even tried
          including several different headers, but always with the same results
          - reaches my website's email account, but not my hotmail account. The
          code I am using to test is:
          >
          <?php
          >
          $body = 'Hello from the internet mail tubes!';
          $subject = 'Test message';
          $address = 'working_addres s@other_domain. com';
          $address2 = 'working_addr.. .@hotmail.com';
          $headers = "From: working_address @this_domain.co m";
          >
          mail($address, $subject, $body, $headers) or print "Can not deliver
          to $address.";
          print "Done with $address.<br>";
          >
          mail($address2, $subject, $body, $headers) or print "Can not deliver
          to $address2.";
          print "Done with $address2.<br>" ;
          >
          ?>
          >
          I think there are some issues with mail(). I'm not sure if thats your
          problem but I ran across a few bugs that it has when I was trying to figure
          out how to mail. They say the pear mail package is much better than this.
          >
          The code I used for testing works fine for hotmail
          >
          <?php
          echo "Sending Mail...<br/>\n";
          $to = 'testa...@hotma il.com'; // changed
          $subject = 'test';
          $message = 'hello';
          $headers = 'From: webmas...@examp le.com' . "\r\n" . // Not changed... just
          crap addr but works
          'Reply-To: webmas...@examp le.com' . "\r\n" .
          'X-Mailer: PHP/' . phpversion();
          >
          mail($to, $subject, $message, $headers) ? print "Sent mail!" : print "Cannot
          send mail";;
          ?>
          >
          You might look at that and see the differences. (as you can see, it uses the
          "\r\n" and some extra info that you might see if it matters or not)

          I started receiving the messages on the hotmail account once I added
          my domain to the safe list in hotmail. That's a step in the right
          direction, but I'd like to figure out what's missing or incorrect
          which makes it get filtered out. Any thoughts on required headers or
          format for hotmail?

          Comment

          • Erwin Moller

            #6
            Re: mail() not reaching hotmail

            e_matthes@hotma il.com wrote:
            On Jun 5, 9:52 am, "Jon Slaughter" <Jon_Slaugh...@ Hotmail.comwrot e:
            ><e_matt...@hot mail.comwrote in message
            >>
            >news:118106191 4.124630.303680 @z28g2000prd.go oglegroups.com. ..
            >>
            >>
            >>
            Hello everyone,
            >>
            I am trying to use the mail() function to send a simple, text-only
            message. I have two websites hosted by the same company, on different
            servers. One is old and established, one I am currently developing.
            I am testing the mail functionality by sending a test message to an
            email account associated with my old website, and to my hotmail
            account. The message seems to be sent to both accounts, and I receive
            the message on my website's email account, but it never reaches my
            hotmail account.
            >>
            Are there any special headers required for hotmail? I've looked
            around a bit, and can't seem to figure it out. I've even tried
            including several different headers, but always with the same results
            - reaches my website's email account, but not my hotmail account. The
            code I am using to test is:
            >>
            <?php
            >>
            $body = 'Hello from the internet mail tubes!';
            $subject = 'Test message';
            $address = 'working_addres s@other_domain. com';
            $address2 = 'working_addr.. .@hotmail.com';
            $headers = "From: working_address @this_domain.co m";
            >>
            mail($address, $subject, $body, $headers) or print "Can not deliver
            to $address.";
            print "Done with $address.<br>";
            >>
            mail($address2, $subject, $body, $headers) or print "Can not deliver
            to $address2.";
            print "Done with $address2.<br>" ;
            >>
            ?>
            >>
            >I think there are some issues with mail(). I'm not sure if thats your
            >problem but I ran across a few bugs that it has when I was trying to
            >figure out how to mail. They say the pear mail package is much better
            >than this.
            >>
            >The code I used for testing works fine for hotmail
            >>
            ><?php
            >echo "Sending Mail...<br/>\n";
            >$to = 'testa...@hotma il.com'; // changed
            >$subject = 'test';
            >$message = 'hello';
            >$headers = 'From: webmas...@examp le.com' . "\r\n" . // Not changed...
            >just crap addr but works
            > 'Reply-To: webmas...@examp le.com' . "\r\n" .
            > 'X-Mailer: PHP/' . phpversion();
            >>
            >mail($to, $subject, $message, $headers) ? print "Sent mail!" : print
            >"Cannot send mail";;
            >?>
            >>
            >You might look at that and see the differences. (as you can see, it uses
            >the "\r\n" and some extra info that you might see if it matters or not)
            >
            >
            I started receiving the messages on the hotmail account once I added
            my domain to the safe list in hotmail. That's a step in the right
            direction, but I'd like to figure out what's missing or incorrect
            which makes it get filtered out. Any thoughts on required headers or
            format for hotmail?
            So PHP's mail() DID work just fine.
            If you configured hotmail to block anything except the domains in your 'safe
            list', what do you expect?
            No header will fix that, unless hotmail is broken.

            Regards,
            Erwin Moller

            Comment

            • e_matthes@hotmail.com

              #7
              Re: mail() not reaching hotmail

              On Jun 6, 2:16 am, Erwin Moller
              <since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
              e_matt...@hotma il.com wrote:
              On Jun 5, 9:52 am, "Jon Slaughter" <Jon_Slaugh...@ Hotmail.comwrot e:
              <e_matt...@hotm ail.comwrote in message
              >
              >news:118106191 4.124630.303680 @z28g2000prd.go oglegroups.com. ..
              >
              Hello everyone,
              >
              I am trying to use the mail() function to send a simple, text-only
              message. I have two websites hosted by the same company, on different
              servers. One is old and established, one I am currently developing.
              I am testing the mail functionality by sending a test message to an
              email account associated with my old website, and to my hotmail
              account. The message seems to be sent to both accounts, and I receive
              the message on my website's email account, but it never reaches my
              hotmail account.
              >
              Are there any special headers required for hotmail? I've looked
              around a bit, and can't seem to figure it out. I've even tried
              including several different headers, but always with the same results
              - reaches my website's email account, but not my hotmail account. The
              code I am using to test is:
              >
              <?php
              >
              $body = 'Hello from the internet mail tubes!';
              $subject = 'Test message';
              $address = 'working_addres s@other_domain. com';
              $address2 = 'working_addr.. .@hotmail.com';
              $headers = "From: working_address @this_domain.co m";
              >
              mail($address, $subject, $body, $headers) or print "Can not deliver
              to $address.";
              print "Done with $address.<br>";
              >
              mail($address2, $subject, $body, $headers) or print "Can not deliver
              to $address2.";
              print "Done with $address2.<br>" ;
              >
              ?>
              >
              I think there are some issues with mail(). I'm not sure if thats your
              problem but I ran across a few bugs that it has when I was trying to
              figure out how to mail. They say the pear mail package is much better
              than this.
              >
              The code I used for testing works fine for hotmail
              >
              <?php
              echo "Sending Mail...<br/>\n";
              $to = 'testa...@hotma il.com'; // changed
              $subject = 'test';
              $message = 'hello';
              $headers = 'From: webmas...@examp le.com' . "\r\n" . // Not changed...
              just crap addr but works
              'Reply-To: webmas...@examp le.com' . "\r\n" .
              'X-Mailer: PHP/' . phpversion();
              >
              mail($to, $subject, $message, $headers) ? print "Sent mail!" : print
              "Cannot send mail";;
              ?>
              >
              You might look at that and see the differences. (as you can see, it uses
              the "\r\n" and some extra info that you might see if it matters or not)
              >
              I started receiving the messages on the hotmail account once I added
              my domain to the safe list in hotmail. That's a step in the right
              direction, but I'd like to figure out what's missing or incorrect
              which makes it get filtered out. Any thoughts on required headers or
              format for hotmail?
              >
              So PHP's mail() DID work just fine.
              If you configured hotmail to block anything except the domains in your 'safe
              list', what do you expect?
              No header will fix that, unless hotmail is broken.
              >
              Regards,
              Erwin Moller

              I didn't configure hotmail to block anything except the domains in my
              'safe list'. I have never used the safe list option, and I've been
              using this account for about 7 years with very little spam, and
              without setting up custom spam filters.

              When no test messages were getting through, I added my new domain to
              the safe list to see if that would let the message through. It did,
              but I don't want everyone to have to put me on their safe list to get
              messages through. So what I'm looking for is a set of headers or
              format that will let messages through on most standard settings.

              Comment

              • Erwin Moller

                #8
                Re: mail() not reaching hotmail

                e_matthes@hotma il.com wrote:
                On Jun 6, 2:16 am, Erwin Moller
                <since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
                > e_matt...@hotma il.com wrote:
                On Jun 5, 9:52 am, "Jon Slaughter" <Jon_Slaugh...@ Hotmail.comwrot e:
                ><e_matt...@hot mail.comwrote in message
                >>
                >>news:11810619 14.124630.30368 0@z28g2000prd.g ooglegroups.com ...
                >>
                Hello everyone,
                >>
                I am trying to use the mail() function to send a simple, text-only
                message. I have two websites hosted by the same company, on
                different
                servers. One is old and established, one I am currently developing.
                I am testing the mail functionality by sending a test message to an
                email account associated with my old website, and to my hotmail
                account. The message seems to be sent to both accounts, and I
                receive the message on my website's email account, but it never
                reaches my hotmail account.
                >>
                Are there any special headers required for hotmail? I've looked
                around a bit, and can't seem to figure it out. I've even tried
                including several different headers, but always with the same
                results
                - reaches my website's email account, but not my hotmail account.
                The code I am using to test is:
                >>
                <?php
                >>
                $body = 'Hello from the internet mail tubes!';
                $subject = 'Test message';
                $address = 'working_addres s@other_domain. com';
                $address2 = 'working_addr.. .@hotmail.com';
                $headers = "From: working_address @this_domain.co m";
                >>
                mail($address, $subject, $body, $headers) or print "Can not deliver
                to $address.";
                print "Done with $address.<br>";
                >>
                mail($address2, $subject, $body, $headers) or print "Can not deliver
                to $address2.";
                print "Done with $address2.<br>" ;
                >>
                ?>
                >>
                >I think there are some issues with mail(). I'm not sure if thats your
                >problem but I ran across a few bugs that it has when I was trying to
                >figure out how to mail. They say the pear mail package is much better
                >than this.
                >>
                >The code I used for testing works fine for hotmail
                >>
                ><?php
                >echo "Sending Mail...<br/>\n";
                >$to = 'testa...@hotma il.com'; // changed
                >$subject = 'test';
                >$message = 'hello';
                >$headers = 'From: webmas...@examp le.com' . "\r\n" . // Not changed...
                >just crap addr but works
                > 'Reply-To: webmas...@examp le.com' . "\r\n" .
                > 'X-Mailer: PHP/' . phpversion();
                >>
                >mail($to, $subject, $message, $headers) ? print "Sent mail!" : print
                >"Cannot send mail";;
                >?>
                >>
                >You might look at that and see the differences. (as you can see, it
                >uses the "\r\n" and some extra info that you might see if it matters
                >or not)
                >>
                I started receiving the messages on the hotmail account once I added
                my domain to the safe list in hotmail. That's a step in the right
                direction, but I'd like to figure out what's missing or incorrect
                which makes it get filtered out. Any thoughts on required headers or
                format for hotmail?
                >>
                >So PHP's mail() DID work just fine.
                >If you configured hotmail to block anything except the domains in your
                >'safe list', what do you expect?
                >No header will fix that, unless hotmail is broken.
                >>
                >Regards,
                >Erwin Moller
                >
                >
                I didn't configure hotmail to block anything except the domains in my
                'safe list'. I have never used the safe list option, and I've been
                using this account for about 7 years with very little spam, and
                without setting up custom spam filters.
                Ok clear. I didn't know that.
                (Never used hotmail)

                Some mailservers are extremely picky when it comes to headers.
                You could try to add a few, like:
                Return-Path
                Meassage-ID

                Maybe that helps. :-/

                Good luck.
                Erwin Moller

                PS: A guy named Gordon Burditt frequents this group and knows a lot more
                about mailprotocols than I do. Maybe contact him. :-)

                Comment

                • e_matthes@hotmail.com

                  #9
                  Re: mail() not reaching hotmail

                  On Jun 6, 9:29 am, Erwin Moller
                  <since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
                  e_matt...@hotma il.com wrote:
                  On Jun 6, 2:16 am, Erwin Moller
                  <since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
                  e_matt...@hotma il.com wrote:
                  On Jun 5, 9:52 am, "Jon Slaughter" <Jon_Slaugh...@ Hotmail.comwrot e:
                  <e_matt...@hotm ail.comwrote in message
                  >
                  >news:118106191 4.124630.303680 @z28g2000prd.go oglegroups.com. ..
                  >
                  Hello everyone,
                  >
                  I am trying to use the mail() function to send a simple, text-only
                  message. I have two websites hosted by the same company, on
                  different
                  servers. One is old and established, one I am currently developing.
                  I am testing the mail functionality by sending a test message to an
                  email account associated with my old website, and to my hotmail
                  account. The message seems to be sent to both accounts, and I
                  receive the message on my website's email account, but it never
                  reaches my hotmail account.
                  >
                  Are there any special headers required for hotmail? I've looked
                  around a bit, and can't seem to figure it out. I've even tried
                  including several different headers, but always with the same
                  results
                  - reaches my website's email account, but not my hotmail account.
                  The code I am using to test is:
                  >
                  <?php
                  >
                  $body = 'Hello from the internet mail tubes!';
                  $subject = 'Test message';
                  $address = 'working_addres s@other_domain. com';
                  $address2 = 'working_addr.. .@hotmail.com';
                  $headers = "From: working_address @this_domain.co m";
                  >
                  mail($address, $subject, $body, $headers) or print "Can not deliver
                  to $address.";
                  print "Done with $address.<br>";
                  >
                  mail($address2, $subject, $body, $headers) or print "Can not deliver
                  to $address2.";
                  print "Done with $address2.<br>" ;
                  >
                  ?>
                  >
                  I think there are some issues with mail(). I'm not sure if thats your
                  problem but I ran across a few bugs that it has when I was trying to
                  figure out how to mail. They say the pear mail package is much better
                  than this.
                  >
                  The code I used for testing works fine for hotmail
                  >
                  <?php
                  echo "Sending Mail...<br/>\n";
                  $to = 'testa...@hotma il.com'; // changed
                  $subject = 'test';
                  $message = 'hello';
                  $headers = 'From: webmas...@examp le.com' . "\r\n" . // Not changed...
                  just crap addr but works
                  'Reply-To: webmas...@examp le.com' . "\r\n" .
                  'X-Mailer: PHP/' . phpversion();
                  >
                  mail($to, $subject, $message, $headers) ? print "Sent mail!" : print
                  "Cannot send mail";;
                  ?>
                  >
                  You might look at that and see the differences. (as you can see, it
                  uses the "\r\n" and some extra info that you might see if it matters
                  or not)
                  >
                  I started receiving the messages on the hotmail account once I added
                  my domain to the safe list in hotmail. That's a step in the right
                  direction, but I'd like to figure out what's missing or incorrect
                  which makes it get filtered out. Any thoughts on required headers or
                  format for hotmail?
                  >
                  So PHP's mail() DID work just fine.
                  If you configured hotmail to block anything except the domains in your
                  'safe list', what do you expect?
                  No header will fix that, unless hotmail is broken.
                  >
                  Regards,
                  Erwin Moller
                  >
                  I didn't configure hotmail to block anything except the domains in my
                  'safe list'. I have never used the safe list option, and I've been
                  using this account for about 7 years with very little spam, and
                  without setting up custom spam filters.
                  >
                  Ok clear. I didn't know that.
                  (Never used hotmail)
                  >
                  Some mailservers are extremely picky when it comes to headers.
                  You could try to add a few, like:
                  Return-Path
                  Meassage-ID
                  >
                  Maybe that helps. :-/
                  >
                  Good luck.
                  Erwin Moller
                  >
                  PS: A guy named Gordon Burditt frequents this group and knows a lot more
                  about mailprotocols than I do. Maybe contact him. :-)
                  Thanks, I'll look out for him. In the mean time, I'll post a message
                  like most other sites do that if the user doesn't receive initial
                  messages, to check their spam filter settings. I'll also play around
                  with headers, starting with the ones you suggested.

                  Comment

                  • Tom

                    #10
                    Re: mail() not reaching hotmail


                    <e_matthes@hotm ail.comwrote in message
                    news:1181065295 .134818.199200@ n15g2000prd.goo glegroups.com.. .
                    On Jun 5, 8:53 am, "Tom" <t...@to.comwro te:
                    <e_matt...@hotm ail.comwrote in message

                    news:1181061914 .124630.303680@ z28g2000prd.goo glegroups.com.. .


                    Hello everyone,
                    I am trying to use the mail() function to send a simple, text-only
                    message. I have two websites hosted by the same company, on different
                    servers. One is old and established, one I am currently developing.
                    I am testing the mail functionality by sending a test message to an
                    email account associated with my old website, and to my hotmail
                    account. The message seems to be sent to both accounts, and I receive
                    the message on my website's email account, but it never reaches my
                    hotmail account.
                    Are there any special headers required for hotmail? I've looked
                    around a bit, and can't seem to figure it out. I've even tried
                    including several different headers, but always with the same results
                    - reaches my website's email account, but not my hotmail account. The
                    code I am using to test is:
                    <?php
                    $body = 'Hello from the internet mail tubes!';
                    $subject = 'Test message';
                    $address = 'working_addres s@other_domain. com';
                    $address2 = 'working_addr.. .@hotmail.com';
                    $headers = "From: working_address @this_domain.co m";
                    mail($address, $subject, $body, $headers) or print "Can not deliver
                    to $address.";
                    print "Done with $address.<br>";
                    mail($address2, $subject, $body, $headers) or print "Can not deliver
                    to $address2.";
                    print "Done with $address2.<br>" ;
                    ?>
                    If you are really using that header, the "other_domain.c om" domain isn't
                    showing up as a valid domain and most current mail systems will reject
                    mail
                    from bogus addresses.

                    Tom
                    --
                    Newsguy.com
                    90+ Days Retention
                    99% Article Completion
                    Can Now Create Your Own NZB Files
                    >
                    Those are all working addresses, I just wrote dummy addresses for this
                    posting:
                    >
                    working_address @other_domain.c om - an address at my established site;
                    working_address @hotmail.com - a working hotmail address;
                    working_address @this_domain.co m - an address on the new site.
                    >
                    Can understand the need for doing that. : )

                    If you haven't done it already, I'd try sending the same exact email from a
                    desktop mail application and see if the results are any different. You might
                    get an error message from your SMTP server or the hotmail mail server that
                    may point to a problem.

                    If you aren't able to get an error back, you might need to check with
                    hotmail to see if they might be filtering something.

                    Tom
                    --
                    Newsguy.com
                    90+ Days Retention
                    Free SSL Connections
                    Create Your Own NZB Files


                    Comment

                    • Jon Slaughter

                      #11
                      Re: mail() not reaching hotmail


                      <e_matthes@hotm ail.comwrote in message
                      news:1181151919 .436905.171490@ z28g2000prd.goo glegroups.com.. .
                      On Jun 6, 9:29 am, Erwin Moller
                      <since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
                      > e_matt...@hotma il.com wrote:
                      On Jun 6, 2:16 am, Erwin Moller
                      <since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
                      > e_matt...@hotma il.com wrote:
                      On Jun 5, 9:52 am, "Jon Slaughter" <Jon_Slaugh...@ Hotmail.com>
                      wrote:
                      ><e_matt...@hot mail.comwrote in message
                      >>
                      >>news:11810619 14.124630.30368 0@z28g2000prd.g ooglegroups.com ...
                      >>
                      Hello everyone,
                      >>
                      I am trying to use the mail() function to send a simple,
                      text-only
                      message. I have two websites hosted by the same company, on
                      different
                      servers. One is old and established, one I am currently
                      developing.
                      I am testing the mail functionality by sending a test message to
                      an
                      email account associated with my old website, and to my hotmail
                      account. The message seems to be sent to both accounts, and I
                      receive the message on my website's email account, but it never
                      reaches my hotmail account.
                      >>
                      Are there any special headers required for hotmail? I've looked
                      around a bit, and can't seem to figure it out. I've even tried
                      including several different headers, but always with the same
                      results
                      - reaches my website's email account, but not my hotmail account.
                      The code I am using to test is:
                      >>
                      <?php
                      >>
                      $body = 'Hello from the internet mail tubes!';
                      $subject = 'Test message';
                      $address = 'working_addres s@other_domain. com';
                      $address2 = 'working_addr.. .@hotmail.com';
                      $headers = "From: working_address @this_domain.co m";
                      >>
                      mail($address, $subject, $body, $headers) or print "Can not
                      deliver
                      to $address.";
                      print "Done with $address.<br>";
                      >>
                      mail($address2, $subject, $body, $headers) or print "Can not
                      deliver
                      to $address2.";
                      print "Done with $address2.<br>" ;
                      >>
                      ?>
                      >>
                      >I think there are some issues with mail(). I'm not sure if thats
                      >your
                      >problem but I ran across a few bugs that it has when I was trying
                      >to
                      >figure out how to mail. They say the pear mail package is much
                      >better
                      >than this.
                      >>
                      >The code I used for testing works fine for hotmail
                      >>
                      ><?php
                      >echo "Sending Mail...<br/>\n";
                      >$to = 'testa...@hotma il.com'; // changed
                      >$subject = 'test';
                      >$message = 'hello';
                      >$headers = 'From: webmas...@examp le.com' . "\r\n" . // Not
                      >changed...
                      >just crap addr but works
                      > 'Reply-To: webmas...@examp le.com' . "\r\n" .
                      > 'X-Mailer: PHP/' . phpversion();
                      >>
                      >mail($to, $subject, $message, $headers) ? print "Sent mail!" :
                      >print
                      >"Cannot send mail";;
                      >?>
                      >>
                      >You might look at that and see the differences. (as you can see, it
                      >uses the "\r\n" and some extra info that you might see if it
                      >matters
                      >or not)
                      >>
                      I started receiving the messages on the hotmail account once I added
                      my domain to the safe list in hotmail. That's a step in the right
                      direction, but I'd like to figure out what's missing or incorrect
                      which makes it get filtered out. Any thoughts on required headers
                      or
                      format for hotmail?
                      >>
                      >So PHP's mail() DID work just fine.
                      >If you configured hotmail to block anything except the domains in your
                      >'safe list', what do you expect?
                      >No header will fix that, unless hotmail is broken.
                      >>
                      >Regards,
                      >Erwin Moller
                      >>
                      I didn't configure hotmail to block anything except the domains in my
                      'safe list'. I have never used the safe list option, and I've been
                      using this account for about 7 years with very little spam, and
                      without setting up custom spam filters.
                      >>
                      >Ok clear. I didn't know that.
                      >(Never used hotmail)
                      >>
                      >Some mailservers are extremely picky when it comes to headers.
                      >You could try to add a few, like:
                      >Return-Path
                      >Meassage-ID
                      >>
                      >Maybe that helps. :-/
                      >>
                      >Good luck.
                      >Erwin Moller
                      >>
                      >PS: A guy named Gordon Burditt frequents this group and knows a lot more
                      >about mailprotocols than I do. Maybe contact him. :-)
                      >
                      Thanks, I'll look out for him. In the mean time, I'll post a message
                      like most other sites do that if the user doesn't receive initial
                      messages, to check their spam filter settings. I'll also play around
                      with headers, starting with the ones you suggested.
                      >
                      If you do find the problem and solution post it here so we'll have a record
                      of it incase someone else runs into it too.

                      Jon


                      Comment

                      • Geoff Muldoon

                        #12
                        Re: mail() not reaching hotmail

                        Tom says...
                        Are there any special headers required for hotmail? I've looked
                        around a bit, and can't seem to figure it out. I've even tried
                        including several different headers, but always with the same results
                        - reaches my website's email account, but not my hotmail account. The
                        code I am using to test is:
                        If you aren't able to get an error back, you might need to check with
                        hotmail to see if they might be filtering something.
                        Not sure about Hotmail, but I had a similar problem with the spam
                        filtering on another service (Gmail?, can recall).

                        The standard PHP mail() function can set the sender address in the header
                        to be different from the canonical sender address in your server's SMTP
                        settings.

                        Try using the optional fifth mail() parameter.

                        $to = 'someone@hotmai l.com';
                        $subject = 'Blah';
                        $message = 'Blah, blah';
                        $headers = '';
                        $params = '-f<insert a known real sender email address here>';

                        mail($to, $subject, $message, $headers, $params);

                        Geoff M

                        Comment

                        • e_matthes@hotmail.com

                          #13
                          Re: mail() not reaching hotmail

                          On Jun 6, 10:44 am, "Jon Slaughter" <Jon_Slaugh...@ Hotmail.comwrot e:
                          <e_matt...@hotm ail.comwrote in message
                          >
                          news:1181151919 .436905.171490@ z28g2000prd.goo glegroups.com.. .
                          >
                          >
                          >
                          On Jun 6, 9:29 am, Erwin Moller
                          <since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
                          e_matt...@hotma il.com wrote:
                          On Jun 6, 2:16 am, Erwin Moller
                          <since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
                          e_matt...@hotma il.com wrote:
                          On Jun 5, 9:52 am, "Jon Slaughter" <Jon_Slaugh...@ Hotmail.com>
                          wrote:
                          <e_matt...@hotm ail.comwrote in message
                          >
                          >news:118106191 4.124630.303680 @z28g2000prd.go oglegroups.com. ..
                          >
                          Hello everyone,
                          >
                          I am trying to use the mail() function to send a simple,
                          text-only
                          message. I have two websites hosted by the same company, on
                          different
                          servers. One is old and established, one I am currently
                          developing.
                          I am testing the mail functionality by sending a test message to
                          an
                          email account associated with my old website, and to my hotmail
                          account. The message seems to be sent to both accounts, and I
                          receive the message on my website's email account, but it never
                          reaches my hotmail account.
                          >
                          Are there any special headers required for hotmail? I've looked
                          around a bit, and can't seem to figure it out. I've even tried
                          including several different headers, but always with the same
                          results
                          - reaches my website's email account, but not my hotmail account.
                          The code I am using to test is:
                          >
                          <?php
                          >
                          $body = 'Hello from the internet mail tubes!';
                          $subject = 'Test message';
                          $address = 'working_addres s@other_domain. com';
                          $address2 = 'working_addr.. .@hotmail.com';
                          $headers = "From: working_address @this_domain.co m";
                          >
                          mail($address, $subject, $body, $headers) or print "Can not
                          deliver
                          to $address.";
                          print "Done with $address.<br>";
                          >
                          mail($address2, $subject, $body, $headers) or print "Can not
                          deliver
                          to $address2.";
                          print "Done with $address2.<br>" ;
                          >
                          ?>
                          >
                          I think there are some issues with mail(). I'm not sure if thats
                          your
                          problem but I ran across a few bugs that it has when I was trying
                          to
                          figure out how to mail. They say the pear mail package is much
                          better
                          than this.
                          >
                          The code I used for testing works fine for hotmail
                          >
                          <?php
                          echo "Sending Mail...<br/>\n";
                          $to = 'testa...@hotma il.com'; // changed
                          $subject = 'test';
                          $message = 'hello';
                          $headers = 'From: webmas...@examp le.com' . "\r\n" . // Not
                          changed...
                          just crap addr but works
                          'Reply-To: webmas...@examp le.com' . "\r\n" .
                          'X-Mailer: PHP/' . phpversion();
                          >
                          mail($to, $subject, $message, $headers) ? print "Sent mail!" :
                          print
                          "Cannot send mail";;
                          ?>
                          >
                          You might look at that and see the differences. (as you can see, it
                          uses the "\r\n" and some extra info that you might see if it
                          matters
                          or not)
                          >
                          I started receiving the messages on the hotmail account once I added
                          my domain to the safe list in hotmail. That's a step in the right
                          direction, but I'd like to figure out what's missing or incorrect
                          which makes it get filtered out. Any thoughts on required headers
                          or
                          format for hotmail?
                          >
                          So PHP's mail() DID work just fine.
                          If you configured hotmail to block anything except the domains in your
                          'safe list', what do you expect?
                          No header will fix that, unless hotmail is broken.
                          >
                          Regards,
                          Erwin Moller
                          >
                          I didn't configure hotmail to block anything except the domains in my
                          'safe list'. I have never used the safe list option, and I've been
                          using this account for about 7 years with very little spam, and
                          without setting up custom spam filters.
                          >
                          Ok clear. I didn't know that.
                          (Never used hotmail)
                          >
                          Some mailservers are extremely picky when it comes to headers.
                          You could try to add a few, like:
                          Return-Path
                          Meassage-ID
                          >
                          Maybe that helps. :-/
                          >
                          Good luck.
                          Erwin Moller
                          >
                          PS: A guy named Gordon Burditt frequents this group and knows a lot more
                          about mailprotocols than I do. Maybe contact him. :-)
                          >
                          Thanks, I'll look out for him. In the mean time, I'll post a message
                          like most other sites do that if the user doesn't receive initial
                          messages, to check their spam filter settings. I'll also play around
                          with headers, starting with the ones you suggested.
                          >
                          If you do find the problem and solution post it here so we'll have a record
                          of it incase someone else runs into it too.
                          >
                          Jon

                          I looked up posts from Gordon, and that was very helpful. I started
                          using the pear:mail package, which did not fix things right away. I
                          found that this combination of headers seems to work:

                          $this->headers['Subject'] = 'Test Subject';
                          $this->headers['From'] = "activeAddress@ myDomain.com";
                          $this->headers['Return-Path'] = "sameActiveAddr ess@mydomain.co m";
                          $this->headers['X-Priority'] = "3";

                          Thanks everyone for the help.

                          Comment

                          Working...