Operating System - HP-UX
1823084 Members
3302 Online
109646 Solutions
New Discussion юеВ

uuencode for external email....with pdf attachment

 
SOLVED
Go to solution
Deepu Chakravarty
Regular Advisor

uuencode for external email....with pdf attachment

1.we are using 'uuencode' for sending email with attachment. Using 'uuencode' email with pdf attachment in internal network is okay. But when we send email outside our domain (like yahoo.com) the attachment gets jumbled. The attachment is not going as it is.
2. We need to send multiple (cc)of the same emails.

Help is required of the above two.

Thanks in advance.
13 REPLIES 13
Steven E. Protter
Exalted Contributor

Re: uuencode for external email....with pdf attachment

Shalom Deepu,

You can use the script I attach or pull code out of it.

http://www.hpux.ws/mailfile2

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
Deepu Chakravarty
Regular Advisor

Re: uuencode for external email....with pdf attachment

Hi SEP,

Thanks for the script. But I can't use this script because I have to use single line command with 'host'.

My requirement is to send mail with pdf attachment from my unix box. I am using 'uuencode' with mailx for the purpose.

Problem is that the mail is going to the desired email address but pdf attachment is not going.
Raj D.
Honored Contributor

Re: uuencode for external email....with pdf attachment

Deepu ,

You can try this :

1. # uuencode file.pdf file.pdf | mailx -s "PDF file attached" yourname@domain.com


cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Deepu Chakravarty
Regular Advisor

Re: uuencode for external email....with pdf attachment

Hi,
The external mail is not getting output as an attachement. The pdf attachment is getting attached in the body of the mail as follows:

Subject: AIS Advanced Shipment Notice

begin 644 o5564027.pdf
M)5!$1BTQ+C$*,2`P(&]B:@H\/`HO0W)E871OM"B]#M075T:&]R("A/M(&1R:79EM;V)J"CP\"B]4>7!E("]086=E
jon2
Advisor

Re: uuencode for external email....with pdf attachment

If the mail goes internally okay but externally it is not is the corruption happening at the point of attachment or when it passes through a mail gateway?

Try compress or gzip prior to attachment.
(maybe this can be on the fly with
cat x.pdf |compress |uuencode - /tmp/x.pdf.Z |mailx -s "file" dest1@host2 dest2@host3

I think just adding a second dest will send a second copy for you.

Deepu Chakravarty
Regular Advisor

Re: uuencode for external email....with pdf attachment

cat o5597927.pdf |compress |uuencode - o5597927.pdf.Z |mailx -s "Test new" abc@yahoo.com

Giving following error:
-: No such file or directory
Null message body; hope that's ok

harry d brown jr
Honored Contributor

Re: uuencode for external email....with pdf attachment

You need to use the "DASH m" option to be able to correctly include mime encoded data:

mailx -m -s "Test new" abc@yahoo.com

live free or die
harry d brown jr
Live Free or Die
Deepu Chakravarty
Regular Advisor

Re: uuencode for external email....with pdf attachment

Dash -m is okay. But filename should also be givien. Pls verify.
Sandman!
Honored Contributor
Solution

Re: uuencode for external email....with pdf attachment

Hi Deepu,

To send attachments to webmail clients like Yahoo do the following steps:

1. Create an empty file with a blank line at the top as follows:
# echo > your_mail_file

2. Verify that the size of the file is 1 byte:
# ll your_mail_file

3. uuencode the PDF file appending its output to your_mail_file:
# uuencode o5564027.pdf o5564027.pdf >> your_mail_file

4. E-mail the file to your Yahoo account using mailx as follows:
# cat your_mail_file | mailx -m -s "subject_goes_here" abc@yahoo.com

hope it helps!
harry d brown jr
Honored Contributor

Re: uuencode for external email....with pdf attachment

uuencode /opt/ignite/share/doc/iuxguide.pdf iuxguide.pdf | mailx -m -s "test pdf" name@domain

live free or die
harry d brown jr
Live Free or Die
Dave La Mar
Honored Contributor

Re: uuencode for external email....with pdf attachment

I'm going to side with Harry's answer.

Attached is a few wxamples that are used in our shop.

Regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."
Deepu Chakravarty
Regular Advisor

Re: uuencode for external email....with pdf attachment

Sandy,
Has done very good job(10/10). His clear steps really resolved my problem. This should be archived for future reference.

Thanks.
Deepu Chakravarty
Regular Advisor

Re: uuencode for external email....with pdf attachment

Sandman's suggestions resolved my query.
Thanks. His suggestions should be archived for future reference.