Link to home
Start Free TrialLog in
Avatar of GAUTAM
GAUTAMFlag for United States of America

asked on

Unix pdf mail attachement error

Hi Experts...
I send a pdf file generated by a java file using a unix script which uses the following command to send the pdf file:
uuencode files sample.pdf | mailx -s "PDF Mail2" user@mailaddress

I receive the pdf file as an attachment in the mail but i get the error when i try to open the pdf attachment.
Please help...
sample-pdf.bmp
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Are you able to open the pdf file before you encode and sent it?
Avatar of GAUTAM

ASKER

@CEHJ:Yes i have FTP'd it to windows and it opens normally.
Only when i send using the above format i am not able to open it.
Please help...
Do not UUENCODE the file ... this will not work with (m)any "modern" email clients ...
Your best choice would be a MIME attachment, which you can't automatically generate with mailx ...
Instead, look into e.g. "metamail" - it contains a program named "metasend" which does what you want without requiring uuencoding (or mimencoding) the file first ... e.g.:

metasend -b -t destuser@mail.com -s "Th Mail Subject" -m application/pdf -f document.pdf

You could try base64-encoding it using the -m option to uuencode...
Avatar of GAUTAM

ASKER

@Garry-G & @CEHJ:Its throwing an error saying metasend command not found.
Please help...
Well maybe you don't have that utility ;)
Depending on your Unix flavor/distribution, you can either just use your packet distribution tool (apt, rpm, yast etc.) to install the binaries, or download the source & compile, eg. from http://ftp.gwdg.de/pub/misc/metamail/
Avatar of GAUTAM

ASKER

@CEHJ:Would the syntax be as follows:
uuencode -m base64-encoding files sample.pdf | mailx -s "PDF Mail4" user@mailaddress as this is not working.
Please help...
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial