====== Проверка работы mail() ======
===== Пример 1 =====
https://www.fryaha.ru/test-sending-emails-through-php/
===== Пример 2 =====
https://centerkey.com/php/
PHP
";
$sendTo = "feedback@yourdomain.com";
$subjectLine = "Feedback Submission";
$thanksUrl = "thanks.html"; //confirmation page
// Build message body from web form input
$body = $_SERVER["SERVER_NAME"] . PHP_EOL . PHP_EOL;
foreach ($_POST as $field=>$value)
$body .= "$field: $value" . PHP_EOL;
$body .= PHP_EOL . @gethostbyaddr($_SERVER["REMOTE_ADDR"]);
$body = htmlspecialchars($body, ENT_NOQUOTES); //make safe
// Send email and direct browser to confirmation page
mail($sendTo, $subjectLine, $body, "From: $sendFrom");
header("Location: $thanksUrl");
?>
HTML
===== Пример 3 =====
http://old.webasyst.ru/support/help/test-mail-function.html
".$_POST['email'].".
";
}else{
$message = "Failed sending message to ".$_POST['email'].".
";
}
}else{
if (isset($_POST['submit'])){
$message = "No email address specified!
";
}
}
if (!empty($message)){
$message .= "
n";
}
?>
Mail test
{{tag>php mail}}