So I am sending emails using ssh2
<?phpfunction Mailitnow($message, $subject, $to) {
include('Net/SSH2.php');
$ssh = new Net_SSH2('my_linux_address');
if (!$ssh->login('user', 'password')) {
exit('Login Failed');
}
$command = "echo \"{$message}\" | mailx -s \"{$subject}\" {$to}";
$ssh->exec($command);}?>
But the problem is that when I send html message it does not get sent as html compared when I send it using php mail() function. I know that's because of the headers.
$subject = "Test";
$message = "<html><head>
<title>Test</title>
</head><body><p>hello awesome person. please click the link</p>
<p><a href='https://stackoverflow.com'>Continue to website...</a></p>
<p>Thanks </p>
</body>
</html>
";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
Mailitnow($message, $subject, $to);
mail($to, $subject, $message, $headers);
Any idea how to include the html headers in my mailitnow function? Thanks a lot in advance.