Chris Hukill
New member
html form:
<form action="sendmail.php" method="post" >
<input type="text" name="name" value="Name" class="input-name"/><br />
<input type="text" name="email" value="Email" class="input-email"/><br />
<textarea name="message" class="input-message" ></textarea>
<input type="image" src="images/send-button.png" value="Submit" class="send-button"/>
</form>
php:
<?php
$to = '***@********.com';
$subject = 'Contact Us';
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
mail( $to, $subject, $message, $email );
header( "Location: http://www.***.com" );
?>
i replaced my sensitive info with ***
where did i go wrong? i have tested this script many times and once i submit the form it takes me to the "successful" page, but but never receive any emails. it was probually some careless mistake on my part.
do i need to include both
$headers = "From: [email protected]" . "\r\n";
and
$headers .= "MIME-Version: 1.0" . "\r\n";
?
this is my corrected php script
<?php
$to = '***@**.com';
$subject = 'Contact Us';
$name = $_POST['name'];
$email = $_POST['email'];
$msg = $_POST['message'];
$headers = "From: $email" . "\r\n";
$headers .= "MIME-Version: 1.0" . "\r\n";
mail( $to, $subject, $msg, $headers );
header( "Location: http://www.***.html" );
?>
<form action="sendmail.php" method="post" >
<input type="text" name="name" value="Name" class="input-name"/><br />
<input type="text" name="email" value="Email" class="input-email"/><br />
<textarea name="message" class="input-message" ></textarea>
<input type="image" src="images/send-button.png" value="Submit" class="send-button"/>
</form>
php:
<?php
$to = '***@********.com';
$subject = 'Contact Us';
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
mail( $to, $subject, $message, $email );
header( "Location: http://www.***.com" );
?>
i replaced my sensitive info with ***
where did i go wrong? i have tested this script many times and once i submit the form it takes me to the "successful" page, but but never receive any emails. it was probually some careless mistake on my part.
do i need to include both
$headers = "From: [email protected]" . "\r\n";
and
$headers .= "MIME-Version: 1.0" . "\r\n";
?
this is my corrected php script
<?php
$to = '***@**.com';
$subject = 'Contact Us';
$name = $_POST['name'];
$email = $_POST['email'];
$msg = $_POST['message'];
$headers = "From: $email" . "\r\n";
$headers .= "MIME-Version: 1.0" . "\r\n";
mail( $to, $subject, $msg, $headers );
header( "Location: http://www.***.html" );
?>