PHP Mail() and Exchange Server
- From: "kippling" <ian.c@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 28 Sep 2005 05:37:40 -0700
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
.
- Follow-Ups:
- Re: PHP Mail() and Exchange Server
- From: Schraalhans Keukenmeester
- Re: PHP Mail() and Exchange Server
- Prev by Date: Please hack my highscore table code
- Next by Date: display contents of mySQL in order of # value in a column
- Previous by thread: Please hack my highscore table code
- Next by thread: Re: PHP Mail() and Exchange Server
- Index(es):
Relevant Pages
|