Operating System - HP-UX
1752494 Members
5463 Online
108788 Solutions
New Discussion юеВ

How to attach documents with sendmail?

 
SOLVED
Go to solution
Deepu Chakravarty
Regular Advisor

How to attach documents with sendmail?

I have configured sendmail and I am receiving mails from my unix box to the smtp mail server. Now I want to receive mails with any attachment. How this can be achieved? How do I attach any document with the mail?
Thanks.
8 REPLIES 8
Sameer_Nirmal
Honored Contributor

Re: How to attach documents with sendmail?

Hi,

Single attachment could be send using
# uuencode /etc/hosts hosts | sendmail abc@xyz.com

Multiple attachment could be send using
#uuencode /etc/hosts hosts;uuencode
/etc/services services)| sendmail abc@xyz.com

You can use mailx or elm as well in above examples.

If you want to send MIME attachement, then
Add the following lines. to /usr/share/lib/mailx.rc file
set charset=X-roman8
set charset=us-ascii
Deepu Chakravarty
Regular Advisor

Re: How to attach documents with sendmail?

hi,

I will use mailx. Then?
Sameer_Nirmal
Honored Contributor
Solution

Re: How to attach documents with sendmail?

You can use mailx like this
#uuencode /etc/hosts hosts.txt | mailx -s "Host file" abc@xyz.com


Deepu Chakravarty
Regular Advisor

Re: How to attach documents with sendmail?

Hi,

uuencode is working. But the attachment is coming in jumbled format. It should come as it is. Any more info?
David Markus
Advisor

Re: How to attach documents with sendmail?

Hi Deepu,

as the name already suggest, uuencode encodes the file you want to transmit. The get the file to its original state, you should decode it first with 'uudecode [filename]'. This way it should be readable again.

greetz,

David
Geoff Wild
Honored Contributor

Re: How to attach documents with sendmail?

Try using mpack to send the file instead:

http://hpux.ee.ualberta.ca/hppd/hpux/Users/mpack-1.6/

Run like so:

/usr/local/bin/mpack -s "svr004 cfg2html" /opt/cfg2html/svr004.html gwild@mydomian.ca


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Steven E. Protter
Exalted Contributor

Re: How to attach documents with sendmail?

Shalom Deepu,

http://www.hpux.ws/mailfile2

uses sendmail, is production tested and easily modified.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sandman!
Honored Contributor

Re: How to attach documents with sendmail?

Hi Deepu,

Need to use "-m" switch with mailx for MIME messages. For ex. to send the /tmp/myfile as an attachment use:

# uuencode /tmp/myfile /tmp/myfile | mailx -m -s "Subject"

cheers!