Operating System - HP-UX
1755170 Members
3537 Online
108830 Solutions
New Discussion юеВ

how to send the attachment through sendmail/mailx

 
gb karki
Frequent Advisor

how to send the attachment through sendmail/mailx

Hi,

How can i send the attachment in HP-UX.
I have tried below option.

uuencode kk.txt|mailx -s "subject"

after that it's not coming in # promt.

I see the below link also.
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1055599

Please need your input.

Regards
Karki
7 REPLIES 7
Suraj K Sankari
Honored Contributor

Re: how to send the attachment through sendmail/mailx

hi,
see the below example
cat your_file | mailx -s"test" you@example.com

Suraj
Laurent Menase
Honored Contributor

Re: how to send the attachment through sendmail/mailx

try
uuencode -m kk.txt - | mailx -s subject email
gb karki
Frequent Advisor

Re: how to send the attachment through sendmail/mailx

Hi Suraj,

This is equivalent of

mailx -s "subject" < file_name

i want file as a attachment.

Regards
Karki
subodhbagade
Regular Advisor

Re: how to send the attachment through sendmail/mailx

Hi,


>how to send the attachment through sendmail/mailx

(1)#uuencode LOGS.txt LOGS.txt | mailx -s " subject " user@xyz.com

this will send the mail with attachment .....if you are not able read the txt then save it and open with wordpad.

here is the diffrence between eg (1) & (2)

(2)# mailx -s " subject " .user@xyz.com
this will send the mail with body (content ) of txt

Regards,
Subodh.

James R. Ferguson
Acclaimed Contributor

Re: how to send the attachment through sendmail/mailx

Hi Karki:

You may want:

# uuencode kk.txt kk.txt|mailx -s "subject"

...which sends the mail and returns the prompt. See the manpages for 'uuencode'.

That said, I have always found Dave La Mar's cheat-sheet for mail and mail attachments invaluable. He attached it in this thread:

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

Regards!

...JRF...
Steven E. Protter
Exalted Contributor

Re: how to send the attachment through sendmail/mailx

Shalom Karki,

I recommend this script:

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

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
Mel Burslan
Honored Contributor

Re: how to send the attachment through sendmail/mailx

In the case

# uuencode kk.txt kk.txt|mailx -s "subject"

comes to your mailbox as a garbled bunch of text instead of attachment, it might mean that, you mail gateway has a different way of interpreting MIME headers. You can overcome this minor headache by inserting a -m switch to your mailx command, like this:

# uuencode kk.txt kk.txt|mailx -m -s "subject"

This always works for me.

Hope this helps.

PS. You have only assigned point to 5 answers out of a possible 75+. Please show courtesy to those trying to help you and assign points to the answers on your questions linked below:

https://forums11.itrc.hp.com/service/forums/pageList.do?userId=WW85728&listType=unassigned&forumId=1
________________________________
UNIX because I majored in cryptology...