The problem is that I have a contact form, it works fine but I need it to contain more fields in the body of the email message.
For example, I have some fields like company, phone, etc ... I would need them in the email body, too.
Let's look at the current situation of CODE PHP
<?php
$name = @trim(stripslashes($_POST['name']));
$from = trim($_POST["email"]);
$subject = "Contato via Site";
$message = trim($_POST["message"]);
$to = "[email protected]";
$headers = array();
$headers[] = "MIME-Version: 1.0";
$headers[] = "Content-type: text/plain; charset=iso-8859-1";
$headers[] = "From: {$name} <{$from}>";
$headers[] = "Reply-To: <{$from}>";
$headers[] = "Subject: {$subject}";
$headers[] = "X-Mailer: PHP/".phpversion();
$header = implode("\r\n", $headers);
if (mail($to, $subject, $message, $header)) {
?>
<script language="JavaScript">
alert("Mensagem enviada.");
</script>
<script language='javascript'>history.back()</script>;
<?
}
?>
Unfortunately, my knowledge of PHP is practically nil.
In short:
I have a contact form, in it is sent only one field in the body of the email, the message. I need to add 3 more fields in the body, Name, Company and Phone.