1

This is my below script which is working fine as it send only plain text email.

So My question is- How can I modify my below script to send this as an HTML formatted email? I want to show the text color of this expression (echo "100*$TEST2/$TEST1" | bc -l) as RED in an email and that can be done only in HTML formatted emails. So that is the reason I was thinking to send an email in HTML formatted way. Any suggestions will be of great help.

#!/bin/bash

TEN_DAYS="3793274 230667"

TEST1=`echo $TEN_DAYS | awk '{print $1}'`
echo $TEST1

TEST2=`echo $TEN_DAYS | awk '{print $2}'`
echo $TEST2

mailx -s "Report" -r [email protected] [email protected] <<EOF

Error  Percentage: `(echo "100*$TEST2/$TEST1" | bc -l)`

EOF

1 Answer 1

1

Here are some ways of sending html type emails with mailx

http://www.unix.com/unix-advanced-expert-users/37480-display-html-text-body-using-unix-mailx.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.