I'm trying to send email with an html file as the body (it's actually a cucumber results report if that matters) or an attachment (if sending it as the body does not work) via the command line
I've tried the following based on the mutt example in this answer to another question, but it is resulting in an error.
cat <<'EOF' Audit_Results.html | mutt -H -
To: [email protected]
Subject: "test sending html mail"
Content-Type: text/html
EOF
when I do this I get the following error
No recipients were specified.
Mutt was installed using brew install mutt
and it looks like that installed version 1.5.21. I am able to send mail via the 'interactive' interface but just tested that with simple text mail, nothing html or with an attachment.
My objective is to send the cucumber results file "Audit_Results.html" file out as an email. Although the file includes some screenshots that are created using webdriver's .screenshot_as(:base64)
method, and embedded using cucumber's embed("data:image/png;base64,#{encoded_img}",'image/png')
function which seems to pose a bit of a problem. So far the one time I've managed to create a html mail from the report (using sendmail) it did not display properly in gmail. (although if sent as an attachment, it will format properly when downloaded and opened with a browser) Seems like gmail at least does not like html email with images embedded in that format. So it may be that I will end up needing to send the html report as an attachment.