how to send mail html format using php


<?php
if(isset($_POST['submit'])){
$name = $_POST['aname'];
$company = $_POST['company'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$typeofservice = $_POST['typeofservice'];
$cellphone = $_POST['cellphone'];
$qtyofproject = $_POST['qtyofproject'];
$specificinformation = $_POST['specificinformation'];
$about = $_POST['about'];
$to='Service@AudioVideoDuplicating.com';
$subject = "Request a Quote";
$message = '
Hello,
Please find below the quote information
Name: ‘.$name.’
Company Name:‘.$company.’
Phone: ‘.$phone.’
Type of Service Preferred: ‘.$typeofservice.’
Cell Phone: ‘.$cellphone.’
Quantity of the Project: ‘.$qtyofproject.’
Other Specified Information: ‘.$specificinformation.’
How did you learn about Audio Video Duplicating: ‘.$about.’
Regards
AVD Audio Video Duplicating
‘;
if(empty($name))
{
$err_msg = “Please Enter Name”;
}
else if(empty($company))
{
$err_msg = “Please Enter Company Name”;
}
else if(empty($phone))
{
$err_msg = “Please Enter Tel Number”;
}
else if(empty($email))
{
$err_msg = “Enter Email Address”;
}
else if(!eregi(“^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$”, $email))
{
$err_msg = “Please Enter Valid Email”;
}
else if(empty($qtyofproject))
{
$err_msg = “Please Select Quantity of Project”;
}
else if($_POST['captcha']!=$_SESSION['security_code']){
$err_msg = “Please Enter Proper Security Code”;
}
else
{
$from = $email;
$headers = “From:” . $from . “\r\n”;
$headers .= ‘MIME-Version: 1.0′ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1′ . “\r\n”;
mail($to, $subject, $message, $headers);
//$msg = ‘success’;
$_SESSION['SUC'] = ‘success’;
echo “location.href=’/request-quote’;”;
//header(‘Location:request-quote.php?msg=success’);
//exit(0);
}
}
?>

Comments

Popular posts from this blog

php format date string short month

curl service example in php