1834974 Members
2129 Online
110073 Solutions
New Discussion

Re: Mailx

 
SOLVED
Go to solution
cbres00
Frequent Advisor

Mailx

I use mailx as a convenient way to manage my tasks. When my job is finished I let mailx send me the nohup.out or the result set from the job. My question is this:
is there a way to use mailx to send me an attachment rather than a dump of the file? S/Cathy
Life is too short not to have fun every single day
15 REPLIES 15
Paul Murray_1
Frequent Advisor

Re: Mailx

I've not tried this with mailx, but the following works with elm - the following example shows how to send an attachment for Excel :-

echo "[include /tmp/excel.csv application/msexcel base64]" | elm -s "Excel file" dummy@dummy.com

You will need to play around with the "application/msexcel" part in order to send other attachment types.


Regards,
Paul.
Just remember, nobody knows everything !!
Paul Murray_1
Frequent Advisor
Solution

Re: Mailx

Sorry, forgot to mention that this is dependant on the version of elm you are running.

Another method is to use UUENCODE - see the following thread for details :-

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x41950559ff7cd4118fef0090279cd0f9!0,00.html


Regs,
Paul.
Just remember, nobody knows everything !!
cbres00
Frequent Advisor

Re: Mailx

So whatever file I send gets
converted to an Excel spreadsheet? What about Access?
Life is too short not to have fun every single day
Rita C Workman
Honored Contributor

Re: Mailx

Cathy,

Here is a thread that discusses in more detail what was suggested. It also shows uuencode and a third party software option....
It's a handy thread, I keep it bookmarked:

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x41950559ff7cd4118fef0090279cd0f9!0,00.html

Hope it helps,
/rcw
Paul Murray_1
Frequent Advisor

Re: Mailx

The file itself doesn't get converted - it just tells the mail engine which application the attachment is for.

In order to send different file types, you will need to change the "application/msexcel" to whatever matches your attachment.

Unfortunately, I do not have a list of the attachment types, but if you search the forums for "elm", you will see a number of threads on this topic.

I've copied a response from Rita Workman which hopefully explains the structure a little better .....


August 09, 2000 20:04 PM GMT [ unassigned ]

--------------------------------------------------------------------------------
I've seen similar requests for this on other messages...and I have sent this before. So I'm sending it again to you...Yes- you can send a file as a TRUE file attachment and actually preserve what the file is...here is the info:
First make sure you at least have Elm 2.4 on your box, and my example is for a HPUX 10.20 (you need MIME capability) so be sure you have patch PHNE_15835 (it doesn't cause a reboot to load).
The next thing you have to do is create a small file (ex include.file) that is used to send the file as an attachment. There are a few things you could read on this for more details at HP's IT Resource if you want. But simple create a file with this syntax:
[include text.txt text/plain base64]

where text.txt is your file.

The general format is: [include filename type/subtype encoding]
type/subtype= text/plain, image/gif, image/jgp etc..
encoding=base64, quoted-printable etc...
Another example might be for a Word doc:
[include file.doc application/msword base64]


Just remember, nobody knows everything !!
Paul Murray_1
Frequent Advisor

Re: Mailx

Rita,

I hope you don't mind me quoting one of your responses, but I thought it would help Cathy,

Regs,
Paul.
Just remember, nobody knows everything !!
cbres00
Frequent Advisor

Re: Mailx

This is spectaculous!
Thank you everyone!
Points have been awarded.

Cathy
Life is too short not to have fun every single day
Rita C Workman
Honored Contributor

Re: Mailx

Paul..

I'm flattered !!

Rita
MANOJ SRIVASTAVA
Honored Contributor

Re: Mailx

Try either one of the following two :

1.There is a simple utility like elm called as mpack (this is the simplest ), check the following site : http://www3.primushost.com/~kylet/unix-att.html

2. Introduce the following line in the .profile of the user sending the mailx x and you will get it as an attachment of notepad .
export LANG=es_ES.iso88591

Manoj


cbres00
Frequent Advisor

Re: Mailx

Tried the second option but I didn't get my file as an attachment.
I did " mailx -s "xyz" cathy.breslow@safeway.com
Did I miss something?
Life is too short not to have fun every single day
MANOJ SRIVASTAVA
Honored Contributor

Re: Mailx

try adding the following , I think what I adviced earlier was just one lineexport LANG=es_ES.iso88591
export LC_CTYPE=es_ES.iso88591
export LC_COLLATE=C

export LC_MONETARY=en_US.iso88591
export LC_NUMERIC=en_US.iso88591
export LC_TIME=en_US.iso88591
export LC_MESSAGES=en_US.iso88591


Manoj

I am also attaching the .profile of the user which I go to me as an attachment .
Christian Schulze
Regular Advisor

Re: Mailx

Hi

I do it this way:

uuencode /path/file /path/file | mailx -m -s "Subject is blabla" name@company.com

/path/file is needed twice by uuencode,
-m does the trick for the mime-Type


Christian
never touch a running system
cbres00
Frequent Advisor

Re: Mailx

Christian,
Thank you for your response!
1) Why does uuencode need
/path/file twice?
2) What's mime?
TIA,
Cathy
Life is too short not to have fun every single day
Rita C Workman
Honored Contributor

Re: Mailx

To answer #2

MIME = Multipurpose Internet Mail Extension.

See this thread for more info:
http://www.nacs.uci.edu/indiv/ehood/MIME/MIME.html

/rcw
cbres00
Frequent Advisor

Re: Mailx

Rock on, Royal Rita!
Thanks much!
cb
Life is too short not to have fun every single day