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)) That's what I have so far, but when I send the email through the form it's all bunched together. I want it to be laid out nice and easy to read. How can I do that? Thanks.
How can I send my form in php with HTML?
6
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)) - Oakleaf
- [1] reply
- CBSnooper
- phpbbxpert
- dealbert.net
- Colton
Next Topics on Trending Feed
-
6