<?php
$conn = mysqli_connect("localhost", "root", "pass", "table");
if ($conn === false) {
die("Ошибка: " . mysqli_connect_error());
}
mysqli_close($conn);
?>
$headers .= "Content-Type: text/html;charset=utf-8 \r\n";
$headers .= "Content-Transfer-Encoding: 8bit \r\n";
прописано