I am adding a contact form on my website, and I would like to send an autoreply email in html. I can send one with php in simple text, but no clue how to add html. Please help!
Here is my code so I can get their info:
And then here is the auto-reply:
Where and how to include the html email I designed baffles me. Any help would be appreciated.
Here is my code so I can get their info:
Code:
$FirstName = $_REQUEST['firstname'] ; $lastname = $_REQUEST['lastname'] ; $companyname = $_REQUEST['companyname'] ; $title = $_REQUEST['title'] ; $phone = $_REQUEST['phone'] ; $phoneext = $_REQUEST['phoneext'] ; $fax = $_REQUEST['fax'] ; $email = $_REQUEST['email'] ; $inquiry = $_REQUEST['inquiry'] ; $subject = "Inquiry Request submitted"; $EmailBody = "This in an inquiry e-mail sent from Website\r\nInquiry Request has been submitted by $FirstName $lastname\n"; $EmailDetails = "Company Name: $companyname\n"; $EmailDetails = $EmailDetails."Title: " . $title . "\n" ; $EmailDetails = $EmailDetails."Phone: " . $phone . "\n"; $EmailDetails = $EmailDetails."Phone Ext: " . $phoneext . "\n"; $EmailDetails = $EmailDetails."Fax: ".$fax."\n" ; $EmailDetails = $EmailDetails."Email: " .$email . "\n"; $EmailDetails = $EmailDetails."Inquiry:\r\n ". $inquiry . "\n"; $message = "$EmailBody \n $EmailDetails"; mail( "rjo@mydomain.com", $subject, $message, "From: $FirstName $lastname <$email>" ); header( "Location: http://www.mydomain.com/thankyou.php" );
And then here is the auto-reply:
Code:
$email = $HTTP_POST_VARS[email]; $mailto = "$email"; $mailsubj = "Thank you for your interest in LSO, Inc."; $mailhead = 'From: No Reply <noreply@lso-inc.com>' . "\r\n"; reset ($HTTP_POST_VARS); $mailbody = "Dear $FirstName $lastname,\r\nThank you for your interest. We will be sure to get back to you within 24 hours.\r\nFor a quicker response, please call us at 1 (800) MY-DOMAIN. \r\n \r\nHere is your original request:\r\n \r\n"; while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
Comment