Knowledgebase: Cpanel Control Panel > PHP
A simple script to check PHP Mail Function is working.
Posted by - NA - on 18 March 2010 03:42 AM
You can use the following php mail script to check PHP Mail Function is working or not.

______________________________

<?php
$to = "user@domain.com";
$subject = "PHP Mail Function Successful";
$message = "This email was sent via PHP's mail() function.";
$result = mail($to,"$subject ",$message, "From:PHPMail-Script");
if ($result){
echo ('Mail Sent');
} else { echo('Error Sending Mail'); }
?>
______________________________
(620 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).