PHP Post Problem on One Server, but not Others

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
jabucket
Forum Newbie
Posts: 7
Joined: Mon Jun 05, 2006 4:57 pm

PHP Post Problem on One Server, but not Others

Post by jabucket »

twigletmac | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I have a customer of mine who has their own web/mail server. Recently, all PHP Post based mail forms have stopped functioning. No error is reported outside of the page that the user is directed to in the event of a failure in script processing (see code below):

Code: Select all

<?php
$to = "aaron@domain.com";
$subject = "Request - $name";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: domain.com <admin@domain.com>\r\n";
$headers .= "Reply-To: ".$name." <".$email.">\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: High\r\n";
$headers .= "X-Mailer: iCEx Networks HTML-Mailer v1.0";
$subject = stripslashes($subject);
$message = stripslashes($message);
$body = "<font face=Arial size=-1><b>$name</b> has submited a Franchise Information Request. <br><br>
Name: <b>$name</b> <br>
Address: <b>$address</b> <br>
Comments: <br>$comments";
$success = @mail($to,$subject,$body,$headers);
?>

<P>

<?php
if($success){
include("sub_thanks.html");
}else{
include("sub_error.html");
}
?>
I am getting this error when turning up the debug spew:
Notice: Undefined variable: headers in E:\domains\cutterspoint\emp_sendmail.php on line 4
Notice: Undefined variable: message in E:\domains\cutterspoint\emp_sendmail.php on line 12

All submissions redirect to the sub_error.html page. This is happening on 3 different scripts on this server, and those scripts all work great on another server, so I am assuming that it is not a code issue. I am running win2k with IIS6. Any ideas?

Jeff


twigletmac | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

First, please use

Code: Select all

tags when posting PHP code.

Remove the error suppression operator from the following line...
[syntax="php"]<?php
// Change this line...
$success = @mail($to,$subject,$body,$headers); 

// to this line...
$success = mail($to,$subject,$body,$headers); 
?>
Next, the undefined variable notices are telling you that you are calling a variable that has not been intialized yet (meaning you haven't assigned it a value/type). Find where these vars get their values and see what is happening their. You may also try troubleshooting by echoing out the values of the vars step by step to see what the script is seeing.[/syntax]
jabucket
Forum Newbie
Posts: 7
Joined: Mon Jun 05, 2006 4:57 pm

Post by jabucket »

I removed the "@" and now have:

Warning: mail(): SMTP server response: 553 5.1.7 <admin@cutterspoint.com>... Invalid sender address in E:\domains\cutterspoint\sendmail.php on line 27

added to my error string. Any idea why this would be different from one server to another?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Are the SMTP server settings different on the one than they were on the other?
jabucket
Forum Newbie
Posts: 7
Joined: Mon Jun 05, 2006 4:57 pm

Post by jabucket »

Could be. I will check and reply after I have a solid answer.

Thanks
Post Reply