Hello All,
I have the most trouble with php, I don't understand it and it makes my head hurt. I finally got my php form to work via smtp on my server @ http://www.25-8media.com/index-2.html. Then I was required to transfer the site over another server, now it gives me this error on the new server:
Warning: mail() [function.mail]: Bad parameters to mail() function, mail not sent. in /home/content/l/i/n/lindbergh771/html/contact.php on line 87
Warning: Cannot modify header information - headers already sent by (output started at /home/content/l/i/n/lindbergh771/html/contact.php:87) in /home/content/l/i/n/lindbergh771/html/contact.php on line 95
The smtp and the ports are the same on both servers the only difference is the email address, which is the only thing that I changed in the entire php document. I attached a copy of the php to this document. I just don't understand why it would stop working with a simple transfer is this beyond me, I am so fustrated!
If anyone could help it would be greatly appreciated!
<?php
$to = 'info@welcometo771.com' ;
$subject = "Application Request" ;
$formurl = "http://welcometo771.com/index-2.html" ;
$errorurl = "http://welcometo771.com/error.html" ;
$thankyouurl = "http://welcometo771/index-7.html" ;
// -------------------- END OF CONFIGURABLE SECTION ---------------
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$phone = $_POST['phone'] ;
$lease=$_POST['lease'] ;
$occupants=$_POST['occupants'] ;
$year=$_POST['year'] ;
$day=$_POST['day'] ;
$month=$_POST['month'] ;
$date = $day.'/'.$month.'/'.$year;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email) || empty($phone) || empty($lease) || empty($occupants) || empty($year) || empty($day) || empty($month)) {
header( "Location: $errorurl" );
exit ;
}
$name = strtok( $name, "\r\n" );
$email = strtok( $email, "\r\n" );
$phone = strtok( $phone, "\r\n" );
$lease = strtok( $lease, "\r\n" );
$occupants = strtok( $occupants, "\r\n" );
$year = strtok( $year, "\r\n" );
$day = strtok( $day, "\r\n" );
$month = strtok( $month, "\r\n" );
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$message ="---------- Yoursite.com message ----------\n\n" . "\nSent by : " . $name . "\nEmail : " . $email . "\nSubject : " . $subject ."\nDate : ".$date."\nLength :".$length."\nOccupants : ".$occupants."\n\n\nMessage : " . $comments;
ini_set("smtp","smtpout.secureserver.net");
ini_set("port","25");
ini_set("sendmail_from","info@welcometo771.com");
mail($to, $subject, "From: \"$name\" <$email>\r\nReply-To: \"$name\" <$email>\r\nX-Mailer: chfeedback.php 2.04\rnName : $name\rnMove in Date : $date\rnPhone : $phone\rnLength Lease : $lease\rn\Occupants : $occupants\rnComments : $comments",$message);
mail($email,"Thanks","From : 771 Lindbergh","Thanks for interest");
header( "Location: $thankyouurl" );
exit ;
?>
The PHP Headache
Moderator: General Moderators
Re: The PHP Headache
Now look at your code.bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )