MOON
Server: Apache
System: Linux e2e-78-16.ssdcloudindia.net 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
User: imensosw (1005)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/imensosw/www/imenso.co/php-mail-test/index.php
<?php

// $disabled_functions = "";
// ini_set('disable_functions', $disabled_functions);
// ini_set('SMPT', 'localhost');
// ini_set('smtp_port ', '25');

// error_reporting(-1);
// ini_set('display_errors', 'On');
// set_error_handler("var_dump");


$to = "dgehlot@imenso.tech";
$subject = "HTML email";

$message = "Test mail.";

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/plain;charset=UTF-8" . "\r\n";

// More headers
$headers .= 'From: <dgehlot@imenso.tech>' . "\r\n";

$result = mail($to,$subject,$message,$headers);
print($result);
if($result){
    echo "Email has been send";
}
else {
    echo "Error in email send";
}
?>