Hello my great PHP gurus, I have a question that might be simple for some of you geniuses. I have simple HTML email form getting sent by a PHP script and I cant get it to work right.
All I want is the get the email, name, subject and in the body I need to have 3 variables ( name (again) Telephone and details. This is the code I have so far:
HTML Form (relevant details only):
<input type="text" name="name" id="name" class="input" />
<input type="text" name="subject" id="subject" class="input" />
<input type="text" name="email" id="customer_mail" class="input" />
<input type="text" name="telephone" id="telephone" class="input" />
<textarea name="detail" cols="10" rows="10" id="detail"></textarea>
The PHP script is:
<?php
// Contact subject
$subject ="$subject";
// Details
$message="$detail";
// Name
$name="$name";
// Mail of sender
$mail_from="$customer_mail";
// From
$header="from: $name <$mail_from>";
// Enter your email address
$to ='onzeon@me.com';
$send_contact=mail($to,$subject,$message,$header);
// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo "We received you message, thank you";
}
else {
echo "ERRO";
}
?>
I also tried this (with no success):
<?php
// Contact subject
$subject ="$assunto";
// Details
$body = $name;
$body .= "/n";
$body .= "Telephone : ".$telephone."/n";
$body .= "Subject : ".$subject."/n";
$body .= "Details : ".$details;
// Name
$name="$name";
// Mail of sender
$mail_from="$customer_mail";
// From
$header="from: $name <$mail_from>";
// Enter your email address
$to ='onzeon@me.com';
$send_contact=mail($to,$subject,$header,$body);
// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
echo "We received you message, thank you";
}
else {
echo "ERRO";
}
?>
CAN ANYONE HELP, PLEASE..
Thank you very much.
Cleve.