Why won't php contact form send to business email

why wont my php contact form work for my buisness email but when iused it for my normal email the form goes through
here is my php code

<?php
/* Email Variables */
$emailSubject = 'prittygals!';
$webMaster = 'buisness email';


/* Data Variables */
$email = $_POST['email'];
$name = $_POST['name'];
$comments = $_POST['comments'];



$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Comments: $comments <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
    $headers);


/* Results rendered as HTML */
$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="3;URL=you sites contact page>
<style type="text/css">
<!--
body {
background-color: #444; /* You can edit this CSS to match your website*/
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #fec001;
text-decoration: none;
padding-top: 200px;
margin-left: 150px;
width: 800px;
}
-->
</style>
</head>
<div align="center">thank you for sending us your question(s) you will be redirected in a few seconds</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>

What does “won’t work” mean? You don’t receive the email in your business email account? Maybe because it doesn’t pass your company’s spam filter?

Let me get this straight… You’re sending an e-mail from an e-mail adress you captured in a form and using it on the FROM field? That’s not good practice.

First look, the code looks Ok although I’ll check later. There are a number of reason why this message is not going through and I guess it is a permissions/security issue.

Part of your configuration should be the smpt server it has to go through and it is very likely that, unless this is published on your web server, under that business domain, it will require authentication which I can’t see on that code.

Try to pubish it and see what happens

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.