Below I have partial of my script. I can send email using this, my only problem is when I read text file (body.txt) it ignores new lines, because of that my body email send one big line.
if I remove
Mime-version:1.0
Content-type:text/html"
Than I it does understand new line on text file. However this time by hyperlinks because plain text, when I want to be html.
links=<a href='deleteserid=test@gmail.com'>Unsubscribe</a>
xmail="/usr/sbin/sendmail"
# Fetches subject.txt generated from input.php page.
xsub=$(cat /data3/sss/subject.txt)
# Show from in email.
xfrom="xxx.net"
# Fetches body.txt generated from input.php page.
xmsg=$(cat /data3/ssss/body.txt)
text="$xmsg <br><br> $links"
echo $text
### Compose emails one at a time, per loop.
"$xmail" "$line" << EOF
subject:$xsub
from:$xfrom
Mime-version:1.0
Content-type:text/html
$text
EOF