I have my script for sending email to some user in Linux. I want to read the string content as HTML in bash, but bash is not able to read string as HTML.
Start of Script:
body ='
Dear $user,
<p> The password for your account is due to expire on in 14 days. and must be changed.<br>
<p>You can reset your password by visiting the Password Reset Portal.</p>
<p><a href="https://google.com/">Google</a> </p>
<p>You can contact the XYZ Team in case of any issue. </p>'
#send email
user='ABC'
email="abc@gmail.co."
from="xyz@gmail.com"
echo $body1 | mail -s test -r $from $email
I wanted my message to user will be shown as below and read string as html
Dear ABC,
The password for your account is due to expire on in 14 days. and must be changed.
You can reset your password by visiting the Password Reset Portal.
Google
You can contact the XYZ Team in case of any issue
However bash is reading the body as a string and not as HTML as below
Dear ABC,
<p> The password for your account is due to expire on in 14 days. and must be changed.</p><br>
<p>You can reset your password by visiting the Password Reset Portal.</p>
<p><a href="https://google.com/">Google</a> </p>
<p>You can contact the XYZ Team in case of any issue. </p>
Please anyone can help me on this.
I have tried the answers from the link Sending HTML mail using a shell script but i am not succeeded.