in questi casi è sempre un errore html

print("\n<meta http-equiv=\"Refresh\" content=\"2, url=invioemail.php?page=".$pagina."\">");

ti mancava l'ultimo \"