13
Check if php mail function is enabled
rated 13 times
[
13]
[
0]
/ comments: 0 / hits: 1213
/ 3 years ago, tue, sep 6, 2016, 10:42:24
How to check if mail function is enabled on your server
<?php
$headers = 'From: admin@example.com' . "\r\n" . 'Reply-To: admin@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
$to = 'info@example.com';
$subject = 'Email Subject';
$text = 'Test email body';
if (mail($to, $subject, $text, $headers)) {
echo "Test php mail sent successfully";
} else {
echo"Message delivery failed";
}
?>
More From
» PHP
Comments
There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account