NameSilo

PHP Mail

Spaceship Spaceship
Watch
Impact
66
Im trying to use the PHP mail function, but it just doesnt seem to work. PHP 4.3.11 is running on the server. my script has:

PHP:
<?php
			$fname=$_POST['fname'];
			$lname=$_POST['lname'];
			$address=$_POST['address'];
			$city=$_POST['city'];
			$state=$_POST['state'];
			$zip=$_POST['zip'];
			$size=$_POST['size'];
			$date=date('l dS \of F Y h:i:s A');
			if($size=="s"){
				$size="12\" x 18\"";
				}
			else if($size=="l"){
				$size="24\" x 36\"";
				}
			$email="[email protected]";
			$subject=$fname . " " . $lname . "Poster Order";
			$body="Order Information:\n" . 
			"First Name: " . $fname . "\n" .
			"Last Name: " . $lname . "\n" . 
			"Address: " . $address . "\n" .
			"City: " . $city . "\n" .
			"State: " . $state . "\n" . 
			"Zip Code: " . $zip . "\n" . 
			"Poster Size: " . $size . "\n" . 
			"Time and date of order: " . $date;
			$header="From: [email protected]" . "\r\n"
			$sent=mail($email,$subject,$body,$header);
			if($sent==TRUE){
			echo Sent;
			}
			else{
			echo Not Sent;
			}
?>

whats wrong with this?

it trips on line 28, which....

NEVERMIND
i figured it out... im missing a semicolon on the line above... damn it. do u see any other errors tho?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
Edit: You have no semicolon after the header = line

Hmm, Im not sure but why do you have this:
PHP:
 $header="From: [email protected]" . "\r\n"

instead of just
PHP:
 $header="From: [email protected]"
 
0
•••
SexualChocolate said:
Hmm, Im not sure but why do you have this:
PHP:
 $header="From: [email protected]" . "\r\n"

instead of just
PHP:
 $header="From: [email protected]"

Take a look in the notes at php.net on the mail page, If I remember correctly if you do not dothis it causes problems with outlook express.
 
0
•••
yeah it was the ; that was tripping it up, but i caught that 10 secs after posting this... thnx neway.

@filth
yep i got that info from php.net.
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back