| | #1 |
| HyperActive Warrior War Room Member Join Date: 2009 Location: Dallas, Texas
Posts: 201
Thanks: 63
Thanked 12 Times in 9 Posts
| Code: if($_POST['name']!='' && $_POST['company']!='' && $_POST['e_mail']!='' && $_POST['telephone']!='' && $_POST['message']!='' && valid_email($_POST['e_mail'])==TRUE && strlen($_POST['message'])>15)
{
$to = 'email@yahoo.com';
$headers = 'From: '.$_POST['e_mail'].''. "\r\n" .
'Reply-To: '.$_POST['e_mail'].'' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$subject = "Message From website.com";
$message = htmlspecialchars($_POST['message']);
$message .= 'Company Name:'.htmlspecialchars($_POST['company']);
$message .= 'Name:'.htmlspecialchars($_POST['name']);
$message .= 'Telephone Number:'.htmlspecialchars($_POST['telephone']);
if(mail($to, $subject, $message, $headers)) |
| |
| | #2 |
| Active Warrior Join Date: 2010
Posts: 36
Thanks: 0
Thanked 1 Time in 1 Post
|
Try adding a few newline chars at the end of the message var like so $message = htmlspecialchars($_POST['message'])."\n"; $message .= 'Company Name:'.htmlspecialchars($_POST['company'])."\n"; $message .= 'Name:'.htmlspecialchars($_POST['name'])."\n"; $message .= 'Telephone Number:'.htmlspecialchars($_POST['telephone'])."\n"; |
| Last edited on 9th Sep 2010 at 03:05 PM. Reason: code | |
| |
| | #3 |
| HyperActive Warrior War Room Member Join Date: 2009 Location: Bradford, UK
Posts: 214
Thanks: 17
Thanked 31 Times in 26 Posts
|
I'd put a < br > between the ' and Company Name, Name and Telephone number. This will make those appear on a new line. $message = htmlspecialchars($_POST['message']); $message .= '<br>Company Name:'.htmlspecialchars($_POST['company']); $message .= '<br> Name:'.htmlspecialchars($_POST['name']); $message .= '<br> Telephone Number:'.htmlspecialchars($_POST['telephone']); [/CODE] |
| | |
| |
| | #4 |
| Web Developer Join Date: 2010 Location: Wisconsin
Posts: 322
Thanks: 2
Thanked 80 Times in 74 Posts
|
HTML breaks will not work unless it is sent as HTML $message = htmlspecialchars($_POST['message']) . "\r\n"; $message .= 'Company Name:'.htmlspecialchars($_POST['company']) . "\r\n" ; $message .= 'Name:'.htmlspecialchars($_POST['name']) . "\r\n" ; $message .= 'Telephone Number:'.htmlspecialchars($_POST['telephone']) . "\r\n" ; |
| | |
| |
| | #5 |
| Bert Join Date: 2010 Location: Pasadena, CA
Posts: 29
Thanks: 0
Thanked 4 Times in 4 Posts
|
Try wufoo.com. It has free form generator, very nice ones too. The fee-based ones allows to create more than 10 fields in a form. I'm not affiliate with wufoo. |
| Last edited on 15th Sep 2010 at 11:17 AM. Reason: typo | |
| |
| | #6 |
| HyperActive Warrior War Room Member Join Date: 2009 Location: Dallas, Texas
Posts: 201
Thanks: 63
Thanked 12 Times in 9 Posts
|
Thanks for the help guys!
|
| |
|
| Bookmarks |
| Tags |
| form, html, php, send |
| |