1. Mail No attachment, just the body:
mailx -m -s "My Subject" billh@abc.com  
        < file_for_email_body
2. Mail with attachement, and no body: 
ux2dos /path_to/some_file |
   uuencode some_file.txt |
   mailx -m -s "MAIL FROM Billh" billh@abc.com
3. Mail with both attachment and body: 
ux2dos /path_to/some_file | 
   uuencode some_file.txt | 
   mailx -m -s "My subject" billh@abc.com 
     < file_for_body
4. Mail with carbon (cc) and blind carbon (bcc): 
mailx -m -s "Some Subject" billh@abc.com  
      < file_for_body
 (Note that this does not work well when using the -r option in mailx.) 
  The file_for_email_body should look like this:
    ~c somebody_to_cc@abc.com 
    ~b somebody_to_bc@abc.com
    The remainder of this file is the 
    body of the email.
5. Mail with multiple attachments and body:
(Leave out the 'Here is some body text' if no body text is needed) 
mailx -m -s "Hello" billh@abc.com << EOF                     
    $(ux2dos /home/blh/.kshrc |
    uuencode /home/blh/.kshrc.txt)    
    $(ux2dos /home/blh/.profile |
    uuencode /home/billh/.profile.txt)
Here is some body text.  
EOF  – See more at: http://serviceitdirect.com/blog/hp-ux-email-attachments#sthash.h3UrBY1c.dpuf
