<?php
$to = '[email protected]';
$subject = 'Test email from PHP';
$message = 'This is a test email to check your mail server configuration.';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-Type: text/plain; charset=UTF-8' . "\r\n";
$headers .= 'FROM: Test message <[email protected]>' . "\r\n";
$headers .= 'Reply-To: [email protected]' . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion() . "\r\n";
// Відправка листа
if(mail($to, $subject, $message, $headers)) {
echo 'Email successfully sent!';
} else {
echo 'Failed to send email.';
}
?>