1752798 Members
5680 Online
108789 Solutions
New Discussion юеВ

attaching mail in Unix.

 
Girish_84
Occasional Contributor

attaching mail in Unix.

how can i attach any file to my mail....full command will help a lot.
E.g:
mail id: g.d@c.com
file name: log_file
sub: LOG
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: attaching mail in Unix.

Shalom,

http://www.hpux.ws/?p=7

The script in that post does all you need it to do.

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
Michal Kapalka (mikap)
Honored Contributor

Re: attaching mail in Unix.

hi,

i think this is a greate a page how could you send a attachment from UNIX.

http://www.panix.com/~kylet/unix-att.html

mikap
John Poff
Honored Contributor

Re: attaching mail in Unix.

Hi,

Here is one way I like to do it with the 'mail' command:

echo "Here is an attachment" | mail -s LOG -a log_file g.d@c.com

I 'echo' the text to mail because the mail command will complain if you don't have any text in the body of the message. That's not a problem from the command line, but it will hang things up if you use it in a script.

JP
Goran┬аKoruga
Honored Contributor

Re: attaching mail in Unix.

Hello.

mutt also supports this:

echo blabla | mutt -s subject -a file ... user@domain

Goran