Argh, I converted my mail script over to an SMTP solution, but now on anything outside of the domains on the server I get this error:

553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)

So it won't send to blah@yahoo.com, blah@msn.com etc etc etc. Yet with outlook, I can send wherever I want.

Is it because I authenticate in Outlook and not in my php script?

I'm doing something like this to send now:

    
$mySTMPprocess->send("HELO mail.mailserver.com"); $mySTMPprocess->send("MAIL FROM:$from"); $mySTMPprocess->send("RCPT TO:$email"); $mySTMPprocess->send("DATA"); $mySTMPprocess->send($theEmailText); $mySTMPprocess->send("RSET"); $mySTMPprocess->send("QUIT");

Is there a way to pass user/pass authentication information? Could that be the problem?

Also, as an FYI, using mail() sends to these addresses just fine.

thanks in advance!

    553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)

    I get that message from my ISP if I haven't checked mail before sending. It also gives me that message if I've not checked my mail for over 5 minutes.

    It's an anti-spam tecnique applied by many web hosts and ISPs. It prevents spammers from relaying their bulk spam through the web server. The trick is to check email before sending so the server authenticates you as a valid user.

    • keith

      Originally posted by keith73
      I get that message from my ISP if I haven't checked mail before sending. It also gives me that message if I've not checked my mail for over 5 minutes.

      It's an anti-spam tecnique applied by many web hosts and ISPs. It prevents spammers from relaying their bulk spam through the web server. The trick is to check email before sending so the server authenticates you as a valid user.

      That may be because your mail server is setup as POP3 before SMTP. My server is just setup as SMTP Auth.... I think that's what is screwing me up.

      I need a way to identify a username/password to the SMTP server. For kicks I tried:

        
      $mySTMPprocess->send("SMTP username:username"); $mySTMPprocess->send("SMTP password:password");

      With no luck... though I got a couple new errors:

      553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)
      503 RCPT first (#5.5.1)
      502 unimplemented (#5.5.1)

        553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)
        503 RCPT first (#5.5.1)

        just for laughs, try polling for new mail before sending. Let's eliminate that as an issue before assuming anything else.

        from what I've been reading, you may also need to have your site's domain name listed in the mail programs configuration files.

        are you using qmail?
        What linux flavor, Red Hat?
        Is this your server or is it being hosted somewhere?

        If it's being hosted somewhere, contact your host.
        If using redhat with sendmail, I found this on their knowledgebase:
        http://kb.redhat.com/view.php?eid=82

        • keith

          I can recreate the error just using Outlook if I turn off the SMTP authentication option, so I know that's the issue.

          I just need to know how to pass the SMTP AUTH information via the PHP code.

            Finally figured it out, I was so close... just had to get the syntax correct.

            After my HELO I added:

              
            
            $mySTMPprocess->send("AUTH LOGIN");
            			$SMTPusername = "email@server.com";
            			$SMTPpassword = "emailpassword";
            			$SMTPusername = base64_encode($SMTPusername);
            			$SMTPpassword = base64_encode($SMTPpassword);
            
            		$mySTMPprocess->send($SMTPusername);
            		$mySTMPprocess->send($SMTPpassword);
            

            Hope that helps someone else.

              Eureka.

              Yes, thanks for posting your solution.

              • keith

                Hi Friends,

                I sending email through the mail() function. However, when an email does not exist or when it does not arrive in its destination, no message of error is returned. has as to make it ???
                if an email not to arrive at its destination it to return for me, equal to outlook makes.

                Thanks,
                !Leonardo Dantas.

                  the message gets bounced back to your server's default email. username@domain.com

                  I think if you include this in the Headers option in mail() it should bounce back to you.

                  Bounce-TO:myemail@mydomain.com

                  ...
                  $headers = "FROM:myemail@domain.com\nBOUNCE-TO:myemail@domain.com";
                  mail($to,$subject,$message,$headers);
                  
                  • keith
                    Write a Reply...