Page 1 of 1

HELP Exchange 2003 and PHP mail() clash HELP HELP HELP

Posted: Sat Feb 21, 2004 6:58 pm
by abshaw
i have a mail() code that works fine with an online website (that already has php configuration (or exchange configuration done). the following code works fine if hosted at dyna host (the online hosting company).



print ("Thankyou ".$Fname." ".$Lname." for your valuable comments");
$EMAIL="ali.abbas@esplans.com";
$SUBJECT="Test email from email_sender.php file script";
$Content="First: ".$Fname."\r\nLast: ".$Lname."\r\nComments: ".$comments."\r\n";
$SENDER = 'toto@mailinator.com'; //Email address of the sender.
$SENDERFULL = 'Harold PHP Quiz Example ' ; // Name of the sender.
$MAILHEADERS .= "CC: test@mailinator.com\r\n";
$MAILHEADERS .= "X-Mailer: PHP\r\n";
$MAILHEADERS .= "X-Priority: 3\r\n";
$MAILHEADERS .= "Return-Path: <".$SENDER.">\r\n";
mail ($EMAIL, $SUBJECT, $Content, $MAILHEADERS);


in the code i have tried with both "r\n" and "\n". both work on dynahost (the online hosting company).

my problem starts when i bring the same piece of code to my machine that is running exchange2003 and windows server 2003,on top of that all i have done is install php from the installer file. the script does not let any email out from this form(code) at all.

i have checked my php.ini and the settings for smtp are correct

what am i missing (please help) and thankyou in advance

Posted: Sun Feb 22, 2004 5:32 am
by abshaw
i know now that it is not my script that is causing the trouble, but the configuration of the server in itself.

either its the exchange server that i have
or its the php.ini settings (that are already on the smtp server)


would changing it back to localhost help (as my web server, mail server and php engine are all on the same machine)

:?

Posted: Sun Feb 22, 2004 12:11 pm
by Derfel Cadarn
... I smell a spammer... :twisted:

Posted: Tue Feb 24, 2004 3:11 am
by abshaw
no i am not a spammer,
i am new to php, and hosting my own website as well. so far it has been working, now i am to the level where i need to use the email part of the script but its totally not working
:?

Posted: Tue Feb 24, 2004 5:04 am
by jigaruu
Try this, it will work on both the servers,

$to1="jigar@mediaibc.com";
$subject="New thing is uploaded on date ".date(" l, d-F-Y");
$message="<br>=================================================================<br> This is a message from Iisha the online management system <br> (please do not reply to this message.This is system responce ) <br> ================================================================="
."<br><br>Date:".date(" l ,d-F ,Y")<br>"

$send_mail=mail("$to1", $subject, $message,"From: BuyerMonitor@$SERVER_NAME\nReply-To: admin@$SERVER_NAME\n"."MIME-Version: 1.0\n"."Content-type: text/html; charset=iso-8859-1") or die("ERROR\ncould not Send the mail");

Posted: Wed Feb 25, 2004 12:45 pm
by abshaw
nope it tells me the following error

Parse error: parse error, unexpected '>'

on the line for $message.

:(

Posted: Thu Feb 26, 2004 4:03 am
by twigletmac
Have a good look at your code with syntax highlighting:

Code: Select all

$to1="jigar@mediaibc.com";
$subject="New thing is uploaded on date ".date(" l, d-F-Y");
$message="<br>=================================================================<br> This is a message from Iisha the online management system <br> (please do not reply to this message.This is system responce ) <br> ================================================================="
."<br><br>Date:".date(" l ,d-F ,Y")<br>"

$send_mail=mail("$to1", $subject, $message,"From: BuyerMonitor@$SERVER_NAME\nReply-To: admin@$SERVER_NAME\n"."MIME-Version: 1.0\n"."Content-type: text/html; charset=iso-8859-1") or die("ERROR\ncould not Send the mail");
Mac

Posted: Thu Feb 26, 2004 4:59 am
by jigaruu
Ok got the error it was just the <br> which was written at the wrong place, try this this will work.

Code: Select all

<?php
$to1="jigar@mediaibc.com";
$subject="New thing is uploaded on date ".date(" l, d-F-Y");
$message="<br>=================================================================<br> This is a message from Iisha the online management system <br> (please do not reply to this message.This is system responce ) <br> ================================================================="
."<br><br>Date:".date(" l ,d-F ,Y")

$send_mail=mail("$to1", $subject, $message,"From: BuyerMonitor@$SERVER_NAMEnReply-To: admin@$SERVER_NAMEn"."MIME-Version: 1.0n"."Content-type: text/html; charset=iso-8859-1") or die("ERRORncould not Send the mail");
?>

Posted: Mon Mar 01, 2004 6:18 pm
by abshaw
thankyou for the reply,

now that the error is past the $message line, it is now creating the error on $send_mail line, here is the error.

Parse error: parse error, unexpected T_VARIABLE


thanks.