This time your script is ok, the connection to the SMTP server is established, but because the host name of the machine that executes your php script is not a valid host name in the SMTP server's local network, the server refuses to accept your request for security reasons (smtp relaying blocked for external hosts).


To avoid this you have (at least) 2 options:

- to use the SMTP server of your provider, i.e. SMTP server for which you are a valid local network host. Keep in mind that the SMTP server does not care about the host name you provide in your code ('$senderFrom = "[EMAIL PROTECTED]";'), but just takes the real host name of machine executing the script.

- to find and use an open relay SMTP server, that smells very much to a spamming activity, so I strongly suggest you to don't do that.


Boyan --



[EMAIL PROTECTED] wrote:
I use this script:

<?

/**
in php.ini - localhost

[mail function]

SMTP = mail.serbis.com; only win32
sendmail_from = [EMAIL PROTECTED];
*/

$msg = "this is a test";
$senderFrom = "[EMAIL PROTECTED]";
$receiverTo = "[EMAIL PROTECTED]";
$subject = "test of the mail function";
$mailHeaders = "From: $senderFrom\n";
$mailHeaders .= "Reply-to: $senderFrom\n";
$mailHeaders .= "Message-Id: 16295644\n";
mail($receiverTo, $subject, $msg, $mailHeaders);
?>

I got this error:

Warning: mail(): SMTP server response: 550 not local host ojpp.myftp.org,
not a gateway in D:\htdocs\ojpp\functions\mail\2.php on line 19

thanks, for any help.




-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to