1832478 Members
2691 Online
110043 Solutions
New Discussion

attachment to a mail!

 
SOLVED
Go to solution
Jonathan Caplette
Regular Advisor

attachment to a mail!

Hi guys...

I've a good one for you... I need to attach a file to mail that I send... I'm using mailx for now, and I think we can't do it with this, and I don't want to use the CDE mailer, cause it's to put into a script...

The file will already been formatted for the "dumb" user who use MS EXCEL... so all they wil have to do is to detach the file and read it....

thanks...
Jonathan
12 REPLIES 12
Victor BERRIDGE
Honored Contributor

Re: attachment to a mail!

Hi,
Have a look at:
http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x41950559ff7cd4118fef0090279cd0f9!0,00.html

May you find an answer that suits...

All the best

Victor
Deshpande Prashant
Honored Contributor

Re: attachment to a mail!

Hi
I create the mwa report files in xls format on my system and use
#uuencode |sendmail
This works for me.
Check man uuencode, in case doubt.

Hope it helps.
Prashant Deshpande.
Take it as it comes.
Jonathan Caplette
Regular Advisor

Re: attachment to a mail!

I tried every method you send me... and when I do the elm or mailx with the < 'filename' it print me the message in the email... when I use the uuencode, I see the ascii code in the email...

anybody have a clue???
MANOJ SRIVASTAVA
Honored Contributor

Re: attachment to a mail!

federico_3
Honored Contributor
Herve BRANGIER
Respected Contributor

Re: attachment to a mail!

Hi

See elm command which work for Mime type and
attachments... (man elm). elm works in command
line and in scripts...

HTH

Herv?

Wilmar Ricio
Occasional Advisor

Re: attachment to a mail!

Hi Jonathan,
You need to use the Measureware 'extract' utility (/opt/perf/bin/extract).

This will produce csv data.

uuencode /tmp/filename.csv filename.csv | sendmail -v jonathan@company.com

- or -

Email the file as a .txt file.
Let your user open it, highlight the whole file, cut and paste to an excel file. From excel, go to Data -> text to column... next... next... finish. Will convert it to excel file.

Gabriele FACCHINI
Frequent Advisor
Solution

Re: attachment to a mail!

Hi to use mailx in a script with an attachment, you can use this following rows:
/usr/bin/mailx -m -s "object" address <<-FINISH
text of messages
blank row
~< ! uuencodede file_name new_file_name
blank row
~.
FINISH
See the attachment for more information.
Gabriele Facchini
Christian Schulze
Regular Advisor

Re: attachment to a mail!

Hi,

dont forget the -m option for mailx

Ex.
uuencode filename filename | mailx -m -s "Subject is ..." my.name@my.company.com

also dont forget to specify filename twice (see man uuencode)

This way you will get a Mail with attached File filename.

Christian
never touch a running system
HSW Support
Advisor

Re: attachment to a mail!

Have a look at downloading mpack. We use this for sending mail attachments via scripts. Help page is at

http://www.uwsg.iu.edu/usail/mail/mime/mpack.html

Mike
Jonathan Caplette
Regular Advisor

Re: attachment to a mail!

It works thanx a lot guys...
Beverly Wixon
Advisor

Re: attachment to a mail!

Hi Johnathan,

Please let me know what you did to make your attachments work correctly. I can't seem to get it to work and I've read all the forums on this and checked out all the links sent. (Of course, I do not have root access to change anything either.)

I need to be able to attach ascii files -- as true attachments, not in the message box.

I would greatly appreciate any help. Feel free to email directly if you prefer:

beverly.wixon@jbosc.ksc.nasa.gov

Thanks a bunch.