How to format the email content using mailx command

140 views Asked by At

I'm trying to send this content using mailx command in bash script. I could see spaces between each lines. How should I remove spaces between each line and the content to look in good format?

echo "Hello there,
      Please find the attachment.
      Email content is having spaces between the lines. I want the spaces to be removed.
      Thanks"| mailx -s "Test Email" "${attachments[@]}" "[email protected]""

Any guidance please.

Mailx command

echo "Hello there,
      Please find the attachment.
      Email content is having spaces between the lines. I want the spaces to be removed.
      Thanks"| mailx -s "Test Email" "${attachments[@]}" "[email protected]""

I want the email content to be well formatted. Thanks!

0

There are 0 answers