If it has to be in one line without newlines use that: echo -e "lalal:lalal opp:ttt ggg:zzz" | sendmail -S "lalalal" -f "dailaakak" -au "kakakak" echo -n interpretes escapes characters such as as a newline.