Operating System - Linux
1753734 Members
4743 Online
108799 Solutions
New Discussion юеВ

Re: Sending attachments with mail utility

 
SOLVED
Go to solution
Andrew Kaplan
Super Advisor

Sending attachments with mail utility

Hi there --

Is it possible to send attachments via the mail utility? If so, what syntax do I need to use? Thanks.
A Journey In The Quest Of Knowledge
6 REPLIES 6
Ivan Ferreira
Honored Contributor
Solution

Re: Sending attachments with mail utility

Probably with:

uuenconde filename filename | mail -s "subject" user@domain

Where filename is the name of the file you want to attach (yes, it's specified twice)
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: Sending attachments with mail utility

I think you can send attachments via mail utility as

# mail -s "Your Subject" -a file1_to_be_attached -a file2_to_be_attached user@domain <~

Regards
Maaz
Wouter Jagers
Honored Contributor

Re: Sending attachments with mail utility

Only a small correction to Maaz' post: the command to use with this syntax would be mutt instead of mail:

# mutt -s "Your Subject" -a file1_to_be_attached -a file2_to_be_attached user@domain

..the easy way to send attachments in linux, should you have mutt installed.

Cheers,
Wout
an engineer's aim in a discussion is not to persuade, but to clarify.
James R. Ferguson
Acclaimed Contributor

Re: Sending attachments with mail utility

Hi Andrew:

See Dave La Mar's attachment in this post for a nice summary guide:

http://itrc.hp.com/service/forums/questionanswer.do?threadId=1055549

Regards!

...JRF...
Andrew Kaplan
Super Advisor

Re: Sending attachments with mail utility

Hi there --

Thanks for the help. I went ahead with the uuencode method, and it works great.

The other approaches mentioned also look good, and I'll keep them in mind.

A Journey In The Quest Of Knowledge
Steven E. Protter
Exalted Contributor

Re: Sending attachments with mail utility

Shalom,

Late but a script with some enhanced abilities, using uuencode.

http://www.hpux.ws/mailfile2

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