Login to SSH with root user
cd /home/
Create test phpmail fine
pico phpmail.php
Insert following code in that file
$to = "recipient@example.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("
Message successfully sent!
");} else {
echo("
Message delivery failed...
");}
?>
Then cange the ownership of that file :
chown user.user phpmail.php
Then test the script in browser or in SSH, you will get follwing result, which means php mail function working fine
-------------------------------------
-bash-2.05b# php phpmail.php
X-Powered-By: PHP/4.4.2
Content-type: text/html
Message successfully sent!
-------------------------------------
0 comments:
Post a Comment