1837249 Members
5146 Online
110115 Solutions
New Discussion

Re: Mail problem

 
Venky_1
Frequent Advisor

Mail problem

Hi ,

What are the options to use in the command line for attaching a file using mail utility ?

Thanks
Venky.
Winners never quit and quitters never win
11 REPLIES 11
Zafar A. Mohammed_1
Trusted Contributor

Re: Mail problem

uuencode | mailx -s "Subject" venky@venky.com

Thanks
Zafar
Uday_S_Ankolekar
Honored Contributor

Re: Mail problem

Try with uuencode

for Exapmple:
If you want to attach myfile from tmp then

uuencode /tmp/myfile filename | mailx -s subject email -id

or uuencode /tmp/myfile filename | sendmail email -id.

you need to type a file name after the attachement

Goodluck
-USA..

Good Luck..
kuksaa_1
New Member

Re: Mail problem

Hi Venky,

uuencode filename.gz < filename.gz | mail user@e-mail.addr -s "Subject"

Hope it helps
Thanks...
Zafar A. Mohammed_1
Trusted Contributor

Re: Mail problem

Geoff Wild
Honored Contributor

Re: Mail problem

Best utility to get is mpack:

http://hpux.ee.ualberta.ca/hppd/hpux/Users/mpack-1.5/

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Venky_1
Frequent Advisor

Re: Mail problem

Hi ,

I would like to send an attachment using mail utility from UNIX server to windows exchange server. ( e.g. pdf file )

Please suggest the options.

Thanks
Sysadmin
Winners never quit and quitters never win
Zafar A. Mohammed_1
Trusted Contributor

Re: Mail problem

uuencode venky.pdf venky.pdf | sendmail venky@venky.com

Thanks
Zafar
Uday_S_Ankolekar
Honored Contributor

Re: Mail problem

The method given can be used to send any kind of attachments.

in your case..

uuencode yourfile.pdf pdffilename | sendmail your-email.id

-USA..

Do you get any errors..??

Good Luck..
Gary Yu
Super Advisor

Re: Mail problem

Hi,

If you send mails to exchange, make sure you are using "-m" option with mailx, otherwise, it won't show up as attachment

thanks,
Gary
Gary Yu
Super Advisor

Re: Mail problem

so the full command should be

uuencode pdffile.pdf attachpdf | mailx -m -s "subject" user@company.com

Steven E. Protter
Exalted Contributor

Re: Mail problem

In this thread is my mailfile script.

Its production and it works great, its also easily modified for other purposes.

Not so well documented, I'll admit, but its based on an HP script.

Just look for my name in the thread and click the attachment icon.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xd45c35a43b46d71190080090279cd0f9,00.html

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