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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
abshaw
Forum Commoner
Posts: 33
Joined: Thu Feb 19, 2004 7:14 pm

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

Post 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
abshaw
Forum Commoner
Posts: 33
Joined: Thu Feb 19, 2004 7:14 pm

Post 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)

:?
User avatar
Derfel Cadarn
Forum Contributor
Posts: 193
Joined: Thu Jul 17, 2003 12:02 pm
Location: Berlin, Germany

Post by Derfel Cadarn »

... I smell a spammer... :twisted:
abshaw
Forum Commoner
Posts: 33
Joined: Thu Feb 19, 2004 7:14 pm

Post 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
:?
jigaruu
Forum Newbie
Posts: 21
Joined: Wed Feb 18, 2004 11:46 pm
Contact:

Post 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");
abshaw
Forum Commoner
Posts: 33
Joined: Thu Feb 19, 2004 7:14 pm

Post by abshaw »

nope it tells me the following error

Parse error: parse error, unexpected '>'

on the line for $message.

:(
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
jigaruu
Forum Newbie
Posts: 21
Joined: Wed Feb 18, 2004 11:46 pm
Contact:

Post 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");
?>
abshaw
Forum Commoner
Posts: 33
Joined: Thu Feb 19, 2004 7:14 pm

Post 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.
Post Reply