Operating System - HP-UX
1753838 Members
8999 Online
108806 Solutions
New Discussion юеВ

Re: 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

Re: attachment to a mail!

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