Operating System - HP-UX
1825751 Members
3109 Online
109687 Solutions
New Discussion

mailx or other mail utility

 
Joe Profaizer
Super Advisor

mailx or other mail utility

Do you know if it is possible to send an attachment when using mailx on Unix? I must have the file sent as an attachment, thus the text of the attachment can't be included in the recipient's email.

Thanks,

..Joe
4 REPLIES 4
Dan Hetzel
Honored Contributor

Re: mailx or other mail utility

Hi Joe,

Here is a reply that has been posted by Chris Anoruo a while ago:

There are three ways to send and attachment.
#(1) Send in body of e-mail mailx -s 'Subject Lines goes here' user@company.com < filename.txt
#(2) To send as an attachment /usr/bin/uuencode filename.Z filename.Z | /usr/sbin/sendmail user@company.com
#(3) To send as an attachment with Subject, From and To
(
echo "From: "
echo "To: "
echo "Subject: "
echo "This is the body of the e-mail.
If you are having any problem with this file please give us a call.


"
/usr/bin/uuencode /local/filename filename
) | /usr/sbin/sendmail user@company.com


Best regards,

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Rita C Workman
Honored Contributor

Re: mailx or other mail utility

Here's a url to show my personal preference for mailing attached files.....Just so you have more choices....

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x41950559ff7cd4118fef0090279cd0f9,00.html

/rcw

MARTINACHE
Respected Contributor

Re: mailx or other mail utility

Hi,

I suggest you to use mpack.

This a free small utility which very simple :

You will find it there :
http://hpux.cs.utah.edu/hppd/hpux/Users/mpack-1.5/
Patrice MARTINACHE
Darrel Louis
Honored Contributor

Re: mailx or other mail utility

Joe,

If you do a search in the forum, you will see several documents.

-m Do not add MIME header lines Mime Version, Content Type & Content Encoding to the header information while sending mails.

example
# uuencode /tmp/testfile testfile.txt | mailx -m -s 'testje' test@mail.com

Check the following discussion:
http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0xa408a24d9abcd4118fef0090279cd0f9!0,00.html

Also check "man mailx "


Good Luck