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

I am getting a dreaded "sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1) " error  when i execute a php page which is trying to send an email.  

sometimes the email gets thru to hotmail.com and yahoo.com addresses but not to addresses like [email protected]  which i want.

now if run outlook express with the mail server settings
I can receive messages instantly but when I send,  they are sent with no errors, but as of this writing I still havent received it at the above addresses including the hotmail.com and yahoo.com addresses. Its been 2 hours now.

btw the host is www.one2host.com and is located in london.

I have tried the regular php mail(), telnetting to the mail server with port 25, ran the MAIL, RCPT commands but still I cant receive the messages at the other end. But if I send messages to myself using these commands  (from booksexchange@stonybrookmsa.com to booksexchange@stonybrookmsa.com) I get the message instantly when I check on outlook.

Now I am trying to execute these same commands in php, and getting the "sorry, that domain isn't in my list of allowed rcpthosts" error on the browser, as I was getting it while doing it with protocol commands.



Below is the output of the php page when executed:

220 plesk250.one2host.com ESMTP  //outputed by my echo
me: HELO mail.stonybrookmsa.com  //outputed by my echo

250 plesk250.one2host.com  //outputed by my echo
MAIL FROM: bookexchange@stonybrookmsa.com  //outputed by my echo

250 ok    //outputed by my echo
RCPT TO:  [email protected]>  //outputed by my echo

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



And at the bottom is the actual php code.

I dont know if you can solve this problem with this just this information. We have been stuck on this for a long time now. We want to be able to send to any email address instead of a hotmail.com or yahoo.com addresses. we have another piece of code which using the standard sendmail() command to email. that code cant also send to ic.sunysb.edu addresses.

And we cant afford to change our host at this point. Please if you can give as much details as possible so that I can email the host. Frankly, they cant figure this problem.



Thank you for your time. Your help will be greatly appreciated.





?php
$result = smtpmail("nayyerzubair@hotmail.com", "subject from php code", "body");

function smtpmail($mail_to, $subject, $message)
{

$smtp_host="mail.stonybrookmsa.com";
$board_email="bookexchange@stonybrookmsa.com";

$socket = fsockopen($smtp_host, 25, $errno, $errstr, 20)

// Send the RFC821 specified HELO.
echo "me: HELO $smtp_host
";
fputs($socket, "HELO $smtp_host\r\n");

// Specify who the mail is from....
echo "MAIL FROM: $board_email
";
fputs($socket, "MAIL FROM: $board_email \r\n");
fputs( $socket, "RCPT TO: $mail_to>\r\n" );
// Ok now we tell the server we are ready to start sending data
fputs($socket, "DATA\r\n");

// Send the Subject Line...
fputs($socket, "Subject: $subject\r\n");

// Now the To Header.
fputs($socket, "$mail_to\r\n");

// Ok now we are ready for the message...
fputs($socket, "$message\r\n");

fputs($socket, ".\r\n");


// Now tell the server we are done and close the socket...
fputs($socket, "QUIT\r\n");
fclose($socket);

return TRUE;

}

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

Looks like plesk250.one2host.com doesn't want to relay from the IP that runs your script to the recipient. Try to send mail through the local MTA.
Random Solutions  
 
programming4us programming4us