Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Web Programming
Reload this Page PHP Mail ~ Message New Line Question
Reply
 
Thread Tools Display Modes
(#1 (permalink))
Old
AKSoapy29's Avatar
Member
AKSoapy29 is on a distinguished road
 
Posts: 63
Join Date: Apr 2011
Exclamation PHP Mail ~ Message New Line Question - 06-23-2012, 04:23 AM

Hello, I am working on a email form, and I need to split each input into a separate line. Ex. the input $name would be on line one in the email, $email would be on line two, and so on. Here is my code that isn't working:

PHP Code:
<html>
<body>

<?php

/* This code here will mail off an email from the webform to ... */

/* These are the fields of the form. The ones with * need to be filled out.
name
email *
subject *
message *
check *
*/

$name=$_POST["name"];
$email=$_POST["email"];
$subject=$_POST["subject"];
$message=$_POST["message"];
$check=$_POST["check"];

$sendemailto="..."// Who to send the email to

print $name;
print 
$email;
print 
$subject;
print 
$message;
print 
$check;

if (
$email=="" or $subject=="" or $message=="" or $check==""){ // If any of these fields are equal to nothing, then
    
print "You have missed some fields. Go back and fill out all of the fields that have a * next to them.";
}elseif (
$email!="" and $subject!="" and $message!="" and $check==...){
    
$message "Name: " $name "\n Email: " $email "\n Subject: " $subject "\n Message: " $message ;
    
$headers "From:" $email;
    
mail($sendemailto,$subject,$message,$headers);
    print 
"Email sent!";
}

?>

</body>
</html>
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
AKSoapy29's Avatar
Member
AKSoapy29 is on a distinguished road
 
Posts: 63
Join Date: Apr 2011
Default 06-23-2012, 04:23 PM

Nevermind, I fixed it.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com