2

I configured my ssmtp as below:

ssmtp.conf

root=postmaster
mailhub=smtp.office365.com:587
Hostname=localhost
FromLineOverride=YES
AuthUser=user@domain.com
AuthPass=mypassword
UseSTARTTLS=YES
TLS_CA_File=/etc/pki/tls/certs/ca-bundle.crt

revaliases

root:user@domain.com:smtp.office365.com:587

mail code is:

echo "HTML formatted message goes here like <b>Bold</b><br /><i>Italic</i>" | mail -s "$(echo -e "Subject \nContent-Type: text/html")"  -r fromEmail@domain.com toemail@domain.com.

Before configuring ssmtp it was working fine now it is sending HTML like <b>Bold</b> code but I want like Bold using ssmtp with mail(sendmail).

Bhesh Sejawal
  • 558
  • 2
  • 7
  • 22

1 Answers1

1

You need to set additional MIME-Version: 1.0 header:

echo "HTML formatted message goes here like <b>Bold</b><br /><i>Italic</i>" | mail -s "$(echo -e 'Subject \nContent-Type: text/html\nMime-Version: 1.0')"  -r fromEmail@domain.com toemail@domain.com
plaes
  • 31,788
  • 11
  • 91
  • 89