Using mailx to send some text instead of file.

I can use mailx to send file using "mailx -s "TEST" abc.com < filename" but how do I use mailx to send some text that I type ?
rgregor6Asked:
Who is Participating?
 
fim32Connect With a Mentor Commented:
or, you can do:
mailx -s "TEST" abc.com << END
type
stuff
here
and end
with
END
0
 
Alf666Commented:
Just type :

mail user@domain.tld

It will ask you for the subject, and then you can type your text in.

End it with a point (".") alone at the beginning of a line.

0
 
ahoffmannCommented:
echo "some text that I type"|mailx -s "TEST" abc.com
# but  fim32's here document is more likely what you need
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.