This question already has an answer here:
- Reference - What does this error mean in PHP? 34 answers
- How do I make a redirect in PHP? 31 answers
I am getting the string "Thank you...etc." - but I am NOT getting the redirect to the thank you page. Any pointers greatly appreciated!!!
Here is the end of the file:
// Send the mail
$mail->SetFrom($email, $name);
$mail->AddReplyTo($email);
$mail->AddAddress($to);
$mail->Subject = "Message from the EnerG2 website";
$mail->Body = $message;
$mail->IsHTML(true);
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Thank you! We have received your message and will get back to you shortly.";
}
// If the errors array has values
} else {}
header('Location: http://www.example.com/thank-you.html');
?>
</div>