Hello,
I'm using PHP and IIS 6. In my php.ini i have specified the SMTP server.
and in my registeration page i use the mail() function to send out a confirmation for users in order for them to activate their account.

Unfortunately a lot of users (roughly 18%) do not receive their confirmation. I checked my mail server (Sendmail) and it seems to be fine. It's jsut that sometimes it can not send emails to some emails which are valid.

The support team took a look at the Mail server and said it was fine. And that i should check the code. Can anything be wrong with the code? Cause some are going and some are not.

Regards

    renegate33 wrote:

    Can anything be wrong with the code?

    Hate to answer a question with a question....
    Can we see the code?

      here you go 🙂

      $email = trim($_REQUEST['txtEmail']);
      $email = htmlspecialchars($email, ENT_QUOTES);

      $to = $email;
      $title = "MY DOMAIN Registration";
      $headers = 'MIME-Version: 1.0' . "\r\n";
      $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
      $tmp = get_rand_id(24);

      $query = "SELECT max(user_id) from phpbb_users";
      $result = mssql_query($query,$link);

      $b_row = mssql_fetch_array($result);
      $userID = $b_row['0'];
      $random = $tmp . $userID;

      $message = "Hello $username, <br> In order to activate your account please click on the following link.<br><p><a href=http://www.xxxxxxxxx.com/activate.php?city=$city2&code=$random>http://www.xxxxxxxx.com/activate.php?city=$city2&code=$random</a><br><p>Thank You<br>xxxxxxx Staff\r\n";

      mail($to,$title,$message,$headers);

        Hi!
        I have found this headers to be useful. Some mailservers needs exactness in the headers syntax, and some ignores mails from webservers.

        define('LINE_END', "\n");
        $from = 'XX';
        
        $headers  = 'MIME-Version: 1.0'.LINE_END;
        $headers .= 'Content-type: text/html; charset=iso-8859-1'.LINE_END;
        $headers .= 'X-Priority: 3'.LINE_END;
        $headers .= 'X-MSMail-Priority: Normal'.LINE_END;
        $headers .= 'X-Mailer: php'.LINE_END;
        $headers .= 'From: '.$from.LINE_END;
        

          DO you think it has anything to do with me not sending a From header? Cause I remember when i was trying to send the FROM header the email would not go through. This is the error I'm getting in the bounce backs.

          ----- The following addresses had permanent fatal errors ----- <XXXXUSER@hotmail.com>
          (reason: 550 Requested action not taken: mailbox unavailable)

          ----- Transcript of session follows ----- ... while talking to mx4.hotmail.com.:

          DATA
          <<< 550 Requested action not taken: mailbox unavailable 550 5.1.1 <XXXXUSER@hotmail.com>... User unknown <<< 503 Need Rcpt command.

            Umm... sounds like an invalid email address to me....

            ... mailbox unavailable .... User unknown

              bpat1434 wrote:

              Umm... sounds like an invalid email address to me....

              well some are actually invalid.. but the rest are actually valid. I get emails from them complaning they didn't get a confirmation!!!! so I know some are valid. I was worried about the 503 Error about RCPT. What does that mean?

                503 - The server has encountered a bad sequence of commands.

                550 - The requested command failed because the user's mailbox was unavailable (for example because it was not found, or because the command was rejected for policy reasons).

                The receipt command is in response to the 550 error.

                  Write a Reply...