Operating System - HP-UX
1821544 Members
2444 Online
109633 Solutions
New Discussion юеВ

Re: How to send and attachment through mail command

 
Dineshkumar
Advisor

How to send and attachment through mail command

Hi All,

I would like send a tar file as an attachment through an mail command from an hpux system

I have tried below syntax for file

mail "system" -f sample - this works fine if its a file

Please suggest me how can i send an attachment using a mail command

Regards
Dinesh
RHCE# 807303594707347
10 REPLIES 10
Patrick Wallek
Honored Contributor

Re: How to send and attachment through mail command

I use the following to e-mail files as attachments:

(echo "Subject: tar file" ; uuencode /path/to/file.tar /path/to/file.tar) | /usr/sbin/sendmail someone@somewhere.com

Just substitute your information where applicable.
spex
Honored Contributor

Re: How to send and attachment through mail command

Hi Dinesh,

# uuencode f1.tar f1.tar | mailx -m -s "f1.tar Attached" your@email.addr

PCS
Dineshkumar
Advisor

Re: How to send and attachment through mail command


Hi

Sorry i have tried both syntax..

Its not working for me..

Regards
Dinesh
RHCE# 807303594707347
Steven E. Protter
Exalted Contributor

Re: How to send and attachment through mail command

Shalom,

A working script you can emulate.

http://www.hpux.ws/mailfile2

The code is readable and will help.

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
spex
Honored Contributor

Re: How to send and attachment through mail command

Dinesh,

Your mail relay may be blocking messages with large attachments. Do you receive anything (i.e. a message with attachment stripped) on the other end? Check mail.log on your HP-UX system and relevant logs on your mail relay.

Will a message with a smaller attachment make it to its destination? How about with a different type of file attached? What if you send the attachment to a local user (bypassing the relay agent)? Or is it an issue with the email application or anti-virus software on the client?

PCS
John Flanagan
Regular Advisor

Re: How to send and attachment through mail command

Try
uuencode file.tar file.tar | mail ........
enrico.nic
Regular Advisor

Re: How to send and attachment through mail command

I use a free utility, mpack, available from
http://hpux.connect.org.uk/hppd/hpux/Users/mpack-1.6/
that encodes the attachment using MIME.

The usage is fairly simple through command line, like

mpack -s "Subject" file address

Cheers

Enrico
Roland Piette
Regular Advisor

Re: How to send and attachment through mail command

Hi,

I found somewhere this utility ....
see attachment.

Roland
Rita C Workman
Honored Contributor

Re: How to send and attachment through mail command

I just create an include file that looks like this:

[include /path/file.ext text/plain base64]

Then I use command line:

elm -s "my file" anybody@company.com < /path/include.file

It doesn't cost a thing, it's easy....

Just a thought,
Rita
Dave La Mar
Honored Contributor

Re: How to send and attachment through mail command

Dinesh -
I have posted this in house doc for many uses of mailx. We use mailx nearly exclusively in our shop. Hope you find one that matches your need.

Regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."