Link to home
Start Free TrialLog in
Avatar of Dan Packer
Dan Packer

asked on

How to send HTML-formatted e-mail through Exchange

I need to route an HTML-formatted e-mail from a Red-Hat server through a client's Office 365 instance.  At the bottom of this post is a command that I can use to reliably route e-mail through their server, it also works with 'mail'.  However, when I attempt to run an HTML file through, the e-mail displays the HTML code, not the rendered page.

I've tried adding MIME and Content-Type into the HTML file (putting the MIME and other header stuff before the <html> tag, and attempted different command line parameters to try to force the output as HTML.  The -a option in this flavor of Linux is to attach a file, so I can't use that to specify the content-type.

Thanks for any help or advice!

-Dan

echo "Test Message 2" | mailx -v -s "Subject" -S smtp-use-starttls -S ssl-verify=ignore -S smtp-auth-login -S smtp=smtp://smtp.office365.com:587 -S from=sales@clientcompany.com -S smtp-auth-user=sales-test@clientcompany.com -S smtp-auth-password=MyPasswordIsHere -S nss-config-dir="/etc/pki/nssdb" danp@destinationemail.com

Thanks for any help or advice!
ASKER CERTIFIED SOLUTION
Avatar of Ricardo Canani
Ricardo Canani
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial