HELP Exchange 2003 and PHP mail() clash HELP HELP HELP
Moderator: General Moderators
HELP Exchange 2003 and PHP mail() clash HELP HELP HELP
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
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
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)

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)
- Derfel Cadarn
- Forum Contributor
- Posts: 193
- Joined: Thu Jul 17, 2003 12:02 pm
- Location: Berlin, Germany
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");
$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");
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Have a good look at your code with syntax highlighting:
Mac
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");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");
?>