I am upgrading some batch programs to produce html output rather than text. The batch programs are run with the at command, which in turn sends all output to the user using the sendmail command.
Because the at command composes the headers for the e-mail I am stuck with how to indicate to either the 'at' command or 'sendmail' that the output of the batched command is in HTML format. The combination of 'at' and 'sendmail' create the headers and terminate the header with a line break so the inclusion of header information, e.g. Content-Type, are considered to be a part of the body.
My expectation is that when the mail is read by a modern client, the Content-type is correctly set to "text/html".
I am happy for any solution, including: command line options, environment variables, bash/perl/awk/ scripts, suggestions for a new batch execution program.
at
have anything to do with it? What are you currently trying? – Mikel Jul 14 '16 at 14:44at
is notmail
. The answers to the proposed duplicate may be applicable, but that doesn't make this a duplicate of that question. – user Jul 14 '16 at 18:47at
to send you the message. Instead, send the mail yourself (in your script) where you have proper control over it. – Chris Davies Jul 14 '16 at 20:46sendmail
, so I think it's close enough. – Mikel Jul 15 '16 at 02:10grep
produce HTML output: don't do that, use the right tool for the job. – Mikel Jul 20 '16 at 03:29