Getting email output in single line with out space in email

I have tried below email method and i am getting every thing in single line . i have put echo to provide space, but it is not helping

my code

(
 echo "From: $FROM"
 echo "To: $MAILTO"
 echo "CC: $CC"
 echo "Subject: $SUBJECT"
 echo "MIME-Version: 1.0"
 echo 'Content-Type: multipart/mixed; boundary="-q1w2e3r4t5"'
 echo
 echo '---q1w2e3r4t5'
 echo "Content-Type: text/html"
 echo "Content-Disposition: inline"
 echo
 echo
 echo $MESSAGE_0
 echo
 echo $DATE
 echo
 echo
 echo
 echo $MESSAGE_1
 echo
 cat $ATTACH3
 echo
 echo $MESSAGE_3
 echo
 cat $ATTACH2
 echo
) | /usr/sbin/sendmail $MAILTO $CC

output i am getting is :

  data collection done START TIME AND DATE : Wed Aug 3 13:15:06 GST 2016 No Issue Found while doing testing for data collection done on below URLs and ports 
  

ideally i want to break each of them in different line with space

---------- Post updated at 04:36 PM ---------- Previous update was at 02:51 PM ----------

thanks.
will do that

---------- Post updated at 05:04 PM ---------- Previous update was at 04:36 PM ----------

sure i will take care

What do you mean by "output I am getting"? There shouldn't be any output but a mail being sent. Are there any log files?

If that's just one single line occurring, chances are that all those echo ed messages and variables are overwriting each other because of <CR> characters in the stream. What OS/shell/editor are you using? Please post the output of od -ctx1 <your_output_line> ...

I am using

SunOS

and you gave me a command to run but what is that

<your_output_line>

i need to pass

The line that you posted after "output i am getting is : ", whereever you got that from. And, please explain where you got it from.

Ohhh - by the way, what be the receiving mail client? Perhaps the problem lies on its side?

This assumes you are complaining about how the final email looks on the user's screen.
You are ultimately writing an html document, not plain text.

echo "Content-Type: text/html"

One way to deal with your problem is to switch from html to text. Another is to use html scripting.

You may want to learn very basic html scripting, one site is here:

HTML br tag

This particular page deals with an html tag <br>. I cannot tell if you want line breaks
or not but place this tag at the end of each line of text you want displayed in email - each tag makes a line break.

It is up to you to find and use the various tags you require to get a correct format in the email.

Going text only is simpler from the programming point of view. Using /usr/bin/mailx instead of sendmail is also an easier approach.

that is my message i have defined

you can see I am passing

$MESSAGE_0
$DATE
$MESSAGE_1

inside to send email

the out put is a defined message, but i am not able to break the line

Next problem:
Consider enclosing "$MESSAGE_0" in double quotes in your echo statement. Do this for most of your echo statements as well.

Why? What happens if one of the words in the message is a UNIX command or a comment -- # character or > character?