Hey there
I wrote php codes for processing to send email but I feel bit hopeless because when you click on send button after filling a form, you got message like “thank you for contacting us”. It is working but I still dont receive this email. I have tested it and send to my email when clicked send button but email didnt come through.
I wonder what is wrong?
Maybe you can check out my codes and tell me where is error? I would appreciate your help.
HTML MARKUP (contactformpage.html)
Email Address:
|
|
Name:
|
|
<tr>
<td><div align="right">
<label for="comments">Comments:</label>
</div></td>
<td><div align="left">
<textarea name="comments" id="comments" cols="26" rows="5"></textarea>
</div></td>
</tr>
<tr>
<td><div align="right">
<label for="clear"></label>
<input type="reset" name="clear" id="clear" value="Reset Form">
</div></td>
<td><div align="right">
<label for="submit"></label>
<div align="left">
<input type="submit" name="submit" id="submit" value="Send Email!">
</div>
</div></td>
</tr>
</table>
[b]
PHP codes (contactformprocess.php)[/b]
<?php
$emailSubject = ‘You got message from your website’;
$webMaster = ‘[email protected]’;
$email = $_POST[‘email’];
$name = $_POST[‘name’];
$comments = $_POST[‘comments’];
$body = <<<EOD
Email: $email
Name: $name
Comments: $comments
EOD;
$headers = “Form:$email\r\n”;
$headers .= “Content-type: text/html\r\n”;
$success = mail($webMaster, $emailSubject, $body, $headers);
$theResults = <<<EOD
Process
Thank you for your interest! Your email will be answered very soon!
EOD;
echo “$theResults”;
?>