hi
i have made a form in html and want to submit a contact form to a client but the formatted mail the client received is like this
<p>Visiteur : pierre lavallée</p>
<br>
<p>Courriel : hfhfhhf@abc.com</p> <br> <p>Province : </p> <br> <p>Téléphone : 4507460632</p> <br> <p>Fax : </p> <br>
<p>Message: essai pour voir!</p>
is there any way to remove the html tag? put the courriel province and telephone on a different line in the mail?
heres the code i use
<?php
//$owner_email = $_POST["owner_email"];
$headers = 'From:' . $_POST["email"];
$subject = 'Un message de vos visiteur : ' . $_POST["name"];
$messageBody = "";
if($_POST['name']!='nope'){
$messageBody .= '<p>Visiteur : ' . $_POST["name"] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['email']!='nope'){
$messageBody .= '<p>Courriel : ' . $_POST['email'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}else{
$headers = '';
}
if($_POST['state']!='nope'){
$messageBody .= '<p>Province : ' . $_POST['state'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['phone']!='nope'){
$messageBody .= '<p>Téléphone : ' . $_POST['phone'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['fax']!='nope'){
$messageBody .= '<p>Fax : ' . $_POST['fax'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['message']!='nope'){
$messageBody .= '<p>Message: ' . $_POST['message'] . '</p>' . "\n";
}
if($_POST["stripHTML"] == 'true'){
$messageBody = strip_tags($messageBody);
}
try{
if(!mail("hugo@h2minfo.com", $subject, $messageBody, $headers)){
throw new Exception('mail failed');
}else{
header('Location: ../index-4.html');
exit;
}
}catch(Exception $e){
echo $e->getMessage() ."\n";
}
?>
thanks for your help
i have made a form in html and want to submit a contact form to a client but the formatted mail the client received is like this
<p>Visiteur : pierre lavallée</p>
<br>
<p>Courriel : hfhfhhf@abc.com</p> <br> <p>Province : </p> <br> <p>Téléphone : 4507460632</p> <br> <p>Fax : </p> <br>
<p>Message: essai pour voir!</p>
is there any way to remove the html tag? put the courriel province and telephone on a different line in the mail?
heres the code i use
<?php
//$owner_email = $_POST["owner_email"];
$headers = 'From:' . $_POST["email"];
$subject = 'Un message de vos visiteur : ' . $_POST["name"];
$messageBody = "";
if($_POST['name']!='nope'){
$messageBody .= '<p>Visiteur : ' . $_POST["name"] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['email']!='nope'){
$messageBody .= '<p>Courriel : ' . $_POST['email'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}else{
$headers = '';
}
if($_POST['state']!='nope'){
$messageBody .= '<p>Province : ' . $_POST['state'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['phone']!='nope'){
$messageBody .= '<p>Téléphone : ' . $_POST['phone'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['fax']!='nope'){
$messageBody .= '<p>Fax : ' . $_POST['fax'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['message']!='nope'){
$messageBody .= '<p>Message: ' . $_POST['message'] . '</p>' . "\n";
}
if($_POST["stripHTML"] == 'true'){
$messageBody = strip_tags($messageBody);
}
try{
if(!mail("hugo@h2minfo.com", $subject, $messageBody, $headers)){
throw new Exception('mail failed');
}else{
header('Location: ../index-4.html');
exit;
}
}catch(Exception $e){
echo $e->getMessage() ."\n";
}
?>
thanks for your help