I am trying to send an email from the work server where a file with columns is attached and although it looks correct on the server, when I send it by mailx and open it in Outlook
the columns, they come out without respecting the format. I have tried both with columns
and with awk
.
Therefore, I have tried to send the mail with format html
but the labels are seen as is in the body of the mail, nothing is applied. As I have found on the internet, the command would be:
mailx -a "Content-Type: text/html;" -s "Prueba" -r [email protected] [email protected] < prueba.html
But -a
in mailx
is interpreted as to attach a file.
Is there a way to send a mail with columns and respect them?
Try the following:
Or the same in one line:
Source: This answer on SO, where several alternatives are discussed (The first one you commented stopped working due to changes in mailx)
Finally, I have found the solution with
sendmail
, following the answer indicated in the SO thread that @Julio posted.With this sentence, I send an email with format
html
andsendmail
: