So I have installed ssmpt and successfully tested email send using ssmpt.
Now the problem is, php mail function fails to send email. I have tried, both the following configuration in php.ini
sendmail_path = sendmail -t -i
or
sendmail_path = /usr/sbin/ssmpt -t
or
sendmail_path = /usr/sbin/sendmail -t
my simple php file is as follows:
<?php
$to = "to@gmail.com";
$subject = "HTML email";
$message = "
<html>
<head>
<title>HTML email</title>
</head>
<body>
<p>This email contains HTML Tags!</p>
</body>
</html>";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
mail($to,$subject,$message,$headers);
?>