HP-UX email with attachments

1. Mail No attachment, just the body:

mailx -m -s "My Subject" [email protected]

        < 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" [email protected]

3. Mail with both attachment and body:

ux2dos /path_to/some_file |

   uuencode some_file.txt | 
   mailx -m -s "My subject" [email protected] 
     < file_for_body

4. Mail with carbon (cc) and blind carbon (bcc):

mailx -m -s "Some Subject" [email protected]

      < 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 [email protected]

    ~b [email protected]
    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" [email protected] << 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


Tags: