NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page PHP Mail

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 10-31-2005, 04:47 PM THREAD STARTER               #1 (permalink)
Senior Member
 
nasaboy007's Avatar
Join Date: Jul 2005
Location: NJ
Posts: 1,219
nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of
 



PHP Mail


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 Code:
<?php
            $fname
=$_POST['fname'];
            
$lname=$_POST['lname'];
????: NamePros.com http://www.namepros.com/programming/136591-php-mail.html
            
$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"){
????: NamePros.com http://www.namepros.com/showthread.php?t=136591
                
$size="12\" x 18\"";
                }
            else if(
$size=="l"){
                
$size="24\" x 36\"";
                }
            
$email="webmaster@example.com";
            
$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: posterorders@example.com" "\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?
nasaboy007 is offline  
Old 10-31-2005, 06:03 PM   #2 (permalink)
Account Closed
Join Date: Jul 2005
Posts: 176
cbr600 is on a distinguished road
 



Edit: You have no semicolon after the header = line

Hmm, Im not sure but why do you have this:
PHP Code:
 $header="From: posterorders@example.com" "\r\n" 
instead of just
PHP Code:
 $header="From: posterorders@example.com" 
????: NamePros.com http://www.namepros.com/showthread.php?t=136591
cbr600 is offline  
Old 11-01-2005, 02:14 AM   #3 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
Originally Posted by SexualChocolate
Hmm, Im not sure but why do you have this:
????: NamePros.com http://www.namepros.com/showthread.php?t=136591
PHP Code:
 $header="From: posterorders@example.com" "\r\n" 
instead of just
PHP Code:
 $header="From: posterorders@example.com" 
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.
Peter is offline  
Old 11-01-2005, 03:04 PM THREAD STARTER               #4 (permalink)
Senior Member
 
nasaboy007's Avatar
Join Date: Jul 2005
Location: NJ
Posts: 1,219
nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of
 



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.
nasaboy007 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple PHP Tell-A-Friend Eric CODE 6 06-07-2006 04:26 AM
Randomingly choosing a quote from Database, PHP SquireQuack Programming 9 10-31-2005 06:50 AM
Simple PHP Form Issue buddybuddha Programming 3 10-30-2005 03:53 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:49 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger