Thanks for the quick reply. I am understanding what you are saying, as it is right now the code sends the email back to address that you input.
I have tried adding:
<?php
$to = $_POST['recipent@mail.com'];
$name = $_POST['name'];
$email = $_POST['email'];
$web = $_POST['web'];
$body = $_POST['text'];
if (!empty($name) & !empty($email) && !empty($body)) {
$body = "Name:{$name}\n\nWebsite :{$web}\n\nComments:{$body}";
$send = mail($email, 'Contact Form Submission', $body, "From: {$email}");
if ($send) {
echo 'true'; //if everything is ok,always return true , else ajax submission won't work
}
}
?>
But this doesn't fix the problem. It still behaves the same way.
Then I tried this:
<?php
$to = "recipent@mail.com";
$name = $_POST['name'];
$email = $_POST['email'];
$web = $_POST['web'];
$body = $_POST['text'];
if (!empty($name) & !empty($email) && !empty($body)) {
$body = "Name:{$name}\n\nWebsite :{$web}\n\nComments:{$body}";
$send = mail($email, 'Contact Form Submission', $body, "From: {$email}");
if ($send) {
echo 'true'; //if everything is ok,always return true , else ajax submission won't work
}
}
?>
But this doesn't fix the problem. It still behaves the same way.
Lastly I tried what you just suggested:
<?php
$name = $_POST['name'];
$email = $_POST['recipent@mail.com'];
$web = $_POST['web'];
$body = $_POST['text'];
if (!empty($name) & !empty($email) && !empty($body)) {
$body = "Name:{$name}\n\nWebsite :{$web}\n\nComments:{$body}";
$send = mail($email, 'Contact Form Submission', $body, "From: {$email}");
if ($send) {
echo 'true'; //if everything is ok,always return true , else ajax submission won't work
}
}
?>
This just breaks the function all together and it won't send the email all or complete the script.
I feel like this is a no-brainer for someone who actually knows and uses PHP regularly.
Any other ideas?