I've been trying to work through sending a html email from mailx on a linux server.
Few Notes:
- I have to specify a smtp server so therefore I cannot use sendmail
(This is not something I can change on my end)
- I cannot install 3rd party things such as mutt. I will have to use
mail or mailx
- Since my mail/x version is heirloom I do not have the --append or -a (attach header options)
- not sure if this helps at all but my linux distro is 7.3 (Maipo)
What I've seen in most posts on stackoverflow for my case:
mailx -v -S smtp=SERVER -s "$(echo -e "This is the subject\nContent-Type: text/html")" -r FROM TO Content-Disposition: inline Message-ID: User-Agent: Heirloom
> mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain;
> charset=us-ascii Content-Transfer-Encoding: 7bit Hello World
Try 2:
So I do not want the headers printed out in the body. So I tried to remove the Content-Disposition: inline
mailx -v -S smtp=SERVER -s "$(echo -e "This is the subject v2\nContent-Type: text/html\nMIME-Version: 1.0")" -r FROM TO `
> Hello World
> `
Try 3:
Tried flip flopping content-type and mime-version
mailx -v -S SERVER -s "$(echo -e "This is the subject v3\nMIME-Version: 1.0\nContent-Type: text/html")" -r FROM TO X-Priority: 1 (Highest) Message-ID: User-Agent: Heirloom mailx
> 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello World
After all of this, I've tried many other adaptations of the above tries but they led to no new output.
So any suggestions or ideas are gladly accepted! Please keep in mind my constraints listed above...I know they limit my options but that's out of my control.
thanks for your time!
Asked by FzZB03KCa46QeaU
(91 rep)
Aug 7, 2017, 04:45 PM
Last activity: Jan 17, 2025, 06:09 AM
Last activity: Jan 17, 2025, 06:09 AM