Instead of isset use simply if
Like this
<?php
if ($sent_mail) {
echo 'Thank you. We will be in touch soon.';
}
else
echo 'Unale to send message';
?>
You are assigning Boolean to $sent_mail and you set it to True.
<?php if($sent_mail){
echo "Email sent successfully";} ?>
mail
function returns a boolean (true/false), so you can do like this
if (mail('myemail.co.uk', $email, $message)) {
echo "Thank you. We will be in touch soon.";
} else {
echo "Something went wrong, the email was not sent!";
}
Also, the structure of mail
(the parameters) are to-address, subject, message. Which means that your current subject is the email-address, I'm not sure if this is what you intended?
Use
if(mail('myemail.co.uk', $email, $message))
$sent_mail = true;
else
$sent_mail = false;
And finally:
<?php
if ($sent_mail) {
echo 'Thank you. We will be in touch soon.';
}
else
echo 'Message cannot be send';
?>