PHP Mail() and Exchange Server



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

.



Relevant Pages

  • mysql_connect error
    ... I got error when using mysql_connect function in my php script. ... If i set the db host to localhost, it give me that error altough all ... even if I gave the permision to 777(just for the testing ...
    (comp.lang.php)
  • Re: mail() function sending emails trapped by IMF
    ... I am using the simple mailfucntion in a php script ... Do you send each message indiviaually or broadcast messages with long ... Talk to the peson who administers the Exchange Server and figure out ... messages or the absence of certain headers... ...
    (comp.lang.php)
  • Re: getaddrinfo failed
    ... The eval line is part of my forum script... ... allows me to run my own PHP script on each page. ... >> Visitors to my site have been getting a random error. ... >host which doesn't respond. ...
    (comp.lang.php)
  • Re: Can you write to a text file with php?
    ... "Tino@tino.com" a écrit le 12/12/2003: ... > host server... ... > What I want to do is have a php script that creates a html file rather ...
    (comp.lang.php)
  • Can you write to a text file with php?
    ... host server... ... What I want to do is have a php script that creates a html file rather ... than just echoing text to the screen. ...
    (comp.lang.php)