I have been using mutt to send emails from inside another application & it works fine. I have to send html files and currently I have to send them as attachments. So I u
If you look at the source of an HTML email, you'll see at minimum something like:
Subject: test html mail
From: sender@example.com
To: recipient@example.com
Content-Type: multipart/alternative; boundary=bcaec520ea5d6918e204a8cea3b4
--bcaec520ea5d6918e204a8cea3b4
Content-Type: text/plain; charset=ISO-8859-1
*hi!*
--bcaec520ea5d6918e204a8cea3b4
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
hi!
--bcaec520ea5d6918e204a8cea3b4--
So, you have to create a "Content-Type:" header, and add the boundaries above the text-only version, and above and below the HTML version.
Given the amount of hand-crafting required, you might as well hand the message over to sendmail instead of mutt.