Operating System - HP-UX
1833329 Members
2847 Online
110051 Solutions
New Discussion

Sending mail as an attachment

 
roadrunner_1
Regular Advisor

Sending mail as an attachment

How do I send file as an attachment using the mail command...
should there any patch installed for the same
2 REPLIES 2
Anthony khan
Frequent Advisor

Re: Sending mail as an attachment

Here is fairly simple method for sending one or multiple files.

for e in `echo file1 file2 file3`
do
uuencode $e $e.txt
done|mailx -m -s "mymail" username@domain.com

Change ".txt" to the proper format of the file e.g. .xls for excel, .doc for word etc
You can use mailx, sendmail, just change the command. Have a look at the various man pages for additional help.

sending for example text file as attachment and that it can be opened by Windows do the
following:

ux2dos YourDocument|uuencode YourDocument.txt|mailx -m -s "Here is your text document" email@domain.com
roadrunner_1
Regular Advisor

Re: Sending mail as an attachment

Thanks..i realised that I could uuencode and it worked fine..anyways points assigned for the reply posted..
No points will be assigned here after.