Operating System - HP-UX
1748225 Members
4444 Online
108759 Solutions
New Discussion юеВ

uuencode - mailx attachment

 
SOLVED
Go to solution
Anand_30
Regular Advisor

uuencode - mailx attachment

I am trying to send some attachment using the following command:

uuencode /location/file.csv filename.csv|/usr/bin/mailx -s "Subject" $EMAIL

It is sending the email with the attachment but the attachment does not conatin any data.

The file is present in the "location" specified and it contains data.

Please help.

Thanks,
Anand

 

 

----------

 

P.S. This thread has been moved from Operating System --> HP-UX --> Languages & Scripting to Operating System --> HP-UX --> Messaging - Forum Moderator

7 REPLIES 7
Steven E. Protter
Exalted Contributor
Solution

Re: uuencode - mailx attachment

Shalom,

http://www.hpux.ws/mailfile2

Your smtp gateway server is capable of chewing up the attachment and causing this problem.

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
Anand_30
Regular Advisor

Re: uuencode - mailx attachment

Thanks Steven,

I am able to send the proper attachment If I execute:

uuencode /location/file.csv filename.csv|/usr/bin/mailx -s "Subject" $EMAIL

from the command line.

It somehow does not seem to work properly from the script.

-Anand
spex
Honored Contributor

Re: uuencode - mailx attachment

Anand,

Check that the user executing the script has read permission for /location/file.csv.

PCS
Sandman!
Honored Contributor

Re: uuencode - mailx attachment

Specify file's full pathname in the uuencode part and add "-m" switch to mailx:

uuencode /location/file.csv /location/file.csv | mailx -m -s "Subject" $EMAIL

hope it helps
Steven E. Protter
Exalted Contributor

Re: uuencode - mailx attachment

I think my script will work for you. I've never had anyone come back and say it doesn't work. Its in production on probably every continent where there are HP-9000 servers.

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
Anand_30
Regular Advisor

Re: uuencode - mailx attachment

Thanks for all the response.

I have found out the issue in my perl script from which I was trying to email the output.

I did not close the filehandler before sending the mail.

I have corrected the issue and it works fine now.

-Anand
ginimix
Occasional Visitor

Re: uuencode - mailx attachment

Hi , i have the same problem. im using

 

uuencode /db01/oraprod/DBTS_270112.html.gz /db01/oraprod/DBTS_270112.html.gz | mailx -m -s "DATABASE" name@foo.com

 

 

when i get the email its like this:

 

begin 644 /db01/oraprod/DBTS_270112.html.gz

M'XL(".L\(D\``T1"5%-?,C<P,3$R+FAT;6P`[=UKCQO'E<;Q]_H4`R\6R+Y(

MI:OZ'D@".#.<T4CDD&)SI+$6"T&VM4D`KYW5.KO(M]^6+S)O2C\Z73-4Q?]?

M$@2.B3AF\+#NYSS\ZOMO_G[RU9^^_O[;[]\]^N)?IN7[?WQQ\O@$P#^+!P\O

M%M?KDXO)V?31%R^FJ_/)]>2+D[/%;+':2'UW]6KZJ"#[0*(.!_VG8._FG:`#

MB6)$!WX#'CS\\SL"#/R3>_#PO]Z\^^^_O7U[TIVM%K/99+ZXN5X_\MG/?WP^

MG4V^[/\P._GJ[9_?_.]?OG_WZ,VW/[Q]]]V;']Y^V,+[^]MOO_W^_Q[_@\G!

M5]_^[>U/\X+R\?ED/3F==-.3_M]FTV[9?[X[64V7B]7ZCR>A_GWF?Q\R'T[^

M>+)<7<TG#__P\__"QP]/5S_^Z]C?&9`<1G3@-^#!C\.DL"&7_>BG#;E_]__A

M^N%V<<X8"R3AP<,?WGSU;3\+__[=-V_?/?(G7_?3\+^^^>:;OWSWIT?AQS_Z

 

 

Please advise

d