I have 3 pages. form for sending email is send-mail.php ..... the coding of sending email is in email.php and then thanks.php and at last redirects to main page of website.
on click on button in send-mail.php...... page the coding of sending email is working well but headers not working. after sending email page is not redirecting to thanks.php and not redirecting to main page of website.
...
send-mail.php
<?php error_reporting(E_ALL); ini_set('display_errors', '1'); ob_start(); ?>
<button class="btn btn-default" name="submit"> --> Send --> </button>
email.php
<?php error_reporting(E_ALL); ini_set('display_errors', '1'); ob_start(); ?>
$headers .= "To: $to" . "\r\n";
$headers .= "From: $email" . "\r\n";
$headers .= "Cc: $cc" . "\r\n";
$headers .= "Bcc: $bcc" . "\r\n";
mail($to,$subject,$message,$headers);
header('Location:thanks.php');
thanks.php
<?php error_reporting(E_ALL); ini_set('display_errors', '1'); ob_start(); ?>
<?php header("Location:refresh:3;url=http://www.myWebsite.com"); ?>