I am not too familiar with PHP but did manage to get a simple contact form together but while the data seems to get submitted okay, the email I get in empty and comes from 'INVALID_ADDRESS@.SYNTAX-ERROR.' which puzzles me very much...!
The other thing I would like to implement is a redirection to a web page after users submit the form.
And this is the PHP code (send_contact.php) I am using to process the data
<?php
// Contact subject
$subject
="$subject";
// Details
$message="$detail";
// Mail of sender
$mail_from="$customer_mail";
// From
$header="from:
$name <$mail_from>";
// Enter your email address
$to
='pierrick419@yahoo.co.uk';
$send_contact=mail($to,$subject,$message,$header);
// Check, if message sent to your email
if($send_contact){
echo "We've received your contact information";
}
else {
echo "ERROR";
}
?>
I figured out the issue above and thought I'd share it
Here is the corrected code for 'send_contact.php'
<?php
// Contact subject
$subject = $_POST['subject'];
// Details
$message = $_POST['detail'];
// Mail of sender
$mail_from = $_POST['customer_mail'];
// From
$header = "from: $name <$mail_from>";
// Enter your email address
$to = 'youremail@something.co.uk';
$send_contact = mail($to,$subject,$message,$header);
// Check, if message sent to your email
if($send_contact){
echo "We've received your contact information";
}
else {
echo "ERROR";
}
?>
Bookmarks