0

I am concatenating xmsg and links to new variable body. What I am trying to accomplish is when email send out. I want new line between xmsg and `links

xmail="sendmail"

links="<a href="https://www.xxx>Unsubscribe</a>"
xmsg='Hello World'
body=$xmsg \n $links

### Compose emails one at a time, per loop.
"$xmail" "$email" << EOF
subject:$xsub
from:$xfrom
Content-Type: text/html;
Mime-version:1.0;
$body
EOF

Excepted output in email

Hello World
Unsubscribe

I tried almost everything here. But none works, either I get blank body in email or all in same line

1 Answer 1

1

You're sending an HTML email and need to use <br> instead of \n.

You need to enclose the whole string in double quotes. Try body="$xmsg <br> $links"

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.