Re: PHP Mail() and Exchange Server
- From: Schraalhans Keukenmeester <nomail@xxxxxxxxxx>
- Date: Thu, 29 Sep 2005 11:21:46 +0200
kippling wrote:
The exchange server is apparantly set to DENY email relays (like it should). In other words it does not accept mails from others that its own domains, to prevent people using it for mass spam relay.I have created a php script to collect inputs from a html form. I host this on the back of my site and have previously had it addressed to send the email to an email address that i'm hosted with. This works fine but when i change the email address to an one which is using exchange server i get the following error:
Warning: mail(): SMTP server response: 554 <app1@xxxxxxxxxxxxx>: Recipient address rejected: Relay access denied in e:\domains\h\hds.co.uk\user\htdocs\test\testmail1.php on line 46
Warning: Cannot modify header information - headers already sent by (output started at e:\domains\h\hds.co.uk\user\htdocs\test\testmail1.php:46) in e:\domains\h\hds.co.uk\user\htdocs\test\testmail1.php on line 47
the php code is: <?
$mailto = 'app1@xxxxxxxxxxxxxxxxxxxxx';
$subject = $_POST['sub'] ;
//$formurl = "http://www.example.com/feedback.html" ; //$errorurl = "http://www.example.com/error.html" ; //$thankyouurl = "http://www.example.com/thankyou.html" ;
$formurl = "http://www.hds.co.uk/hds/formtest.htm" ; $errorurl = "http://www.hds.co.uk/hds/error.htm" ; $thankyouurl = "http://www.hds.co.uk/hds/sent.htm" ; $fullname = $_POST['fullname'] ; $address = $_POST['address']; $email = $_POST['email']; $http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ; } if (empty($fullname) || empty($address)) { header( "Location: $errorurl" ); exit ; } if (get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); }
$messageproper = "$http_referrer\n" . " full Name: $fullname Address: $address ";
mail($mailto, $subject, $messageproper, "From: \"$fullname\" <$email>\n Reply-To: \"$fullname\" <$email>\n X-Mailer: app1 ver 1.0\n MIME-Version: 1.0\n Content-type: text/plain; charset=iso-8859-1\n X-Priority: 3\n X-MSMail-Priority: Normal\n" ); header( "Location: $thankyouurl" ); exit ;
?>
why can i not send my message to an exchange server am I missing something. Please Help.
Kippling
Sh .
- References:
- PHP Mail() and Exchange Server
- From: kippling
- PHP Mail() and Exchange Server
- Prev by Date: Re: Please hack my highscore table code
- Next by Date: Re: Job submission to background and mail results?
- Previous by thread: PHP Mail() and Exchange Server
- Next by thread: display contents of mySQL in order of # value in a column
- Index(es):
Relevant Pages
|