Operating System - HP-UX
1847348 Members
3841 Online
110264 Solutions
New Discussion

mailx corrupting file when sent to lotus notes account

 
SOLVED
Go to solution
Derek Brown
Frequent Advisor

mailx corrupting file when sent to lotus notes account

Can anyone help please !!
The following syntax is supposed to send a file from a unix server to my lotus notes account as an Excel spreadsheet attachment to an email :

# uuencode SAP_PAYROLL_FILE.CSC \ SAP_PAYROLL_FILE.CSV | mailx -r \ ngt_app@ngtuk.com -s "Sap Payroll File" \ dbrown206@csc.com

But... the file is expanded into the body of the email as jibberish (hex or binary or something) !! Anyone have any ideas ? I have checked my file associations on my PC and found that filetype of CSV is assoiciated with Microsoft Excel
9 REPLIES 9
Steven E. Protter
Exalted Contributor
Solution

Re: mailx corrupting file when sent to lotus notes account

Greetings Derek,

I'm attaching a proven production sendmail program that does attachments properly.

http://www.hpux.ws/mailfile2

Its possible if your smtp gateway software is not patched properly that the attachment is fine and being garbled there. If my program produces similar results check with your smtp gateway administrator.

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
Jeff_Traigle
Honored Contributor

Re: mailx corrupting file when sent to lotus notes account

Quite possibly Lotus having problems with the attachment. I had the same problem with a CSV file I was trying to send to Mozilla Thunderbird recently. Never had a problem sending to Outlook like that.
--
Jeff Traigle
Raj D.
Honored Contributor

Re: mailx corrupting file when sent to lotus notes account

Good Day Derek ,

Are you trying to send two file as attachment to Lotus notes account.
That is :
1. SAP_PAYROLL_FILE.CSC
2. SAP_PAYROLL_FILE.CSV

You can try this ,

# uuencode SAP_PAYROLL_FILE.CSC SAP_PAYROLL_FILE.CSC | mailx -s "Sap Payroll File" dbrown206@csc.com

# uuencode SAP_PAYROLL_FILE.CSV SAP_PAYROLL_FILE.CSV | mailx -s "Sap Payroll File2" dbrown206@csc.com

Hope this will work..

Enjoy,

Cheers,
Raj.





" If u think u can , If u think u cannot , - You are always Right . "
Dave La Mar
Honored Contributor

Re: mailx corrupting file when sent to lotus notes account

Derek -
Attached find multiple examples of using mailx, with/without multiple attachments.

First guess would be the lack of the -m switch in your command.

Regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."
Derek Brown
Frequent Advisor

Re: mailx corrupting file when sent to lotus notes account

Hi,

Thanks very much for the replies guys. That's fantastic. The reply from Steven Protter is the one that seems to work first time so thanks very much for that.

One final question to Steven on his solution.... how could your script be amended to include multiple "MAIL TO" addresses ?
Steven E. Protter
Exalted Contributor

Re: mailx corrupting file when sent to lotus notes account

Yes I belive you merely need to build the string and put it in the appropriate variable.

http://www.isnamerica.com/contactsep.shtml

If you need mod's on the script or post here.

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
Dave La Mar
Honored Contributor

Re: mailx corrupting file when sent to lotus notes account

Derek -

On the multiple addressees, my samples lacked noting that. I appreciate you pointing that out so it could be updated accordingly.

For future users that may read this thread, I haved attached the updated samples doc.

No points for this please, give yourself 10 for pointing out the deficiency in my doc.

Regards,

dl
"I'm not dumb. I just have a command of thoroughly useless information."
Derek Brown
Frequent Advisor

Re: mailx corrupting file when sent to lotus notes account

Reply FAO Steven Protter

Steven,
I conted you websire address but keot getting "Internal Server Error" have come back to this forum.

Here is a cut and paste of what I tried to send to you :

Steven,

RE: My thread on the HP ITRC Forum called "mailx corrupting file when sent to lotus notes account". Your answer was FANTASTIC and it's helped me solve something I had problems with for ages. But... I'd just like to increase my understanding in these 3 areas if I could please :

1). What is the function of parameter 5 (full_path) ? It doesnt seem to do anything other than appear in the subject line along with parameter 6 (subject).

2) You've written it to allow mails only from root, sag, and coperato. Am I right in saying I can delete the associated code so that any user can send mail ?

3) This is actually the most important thing for me. I need to send the same file as an attachment to 8 or 9 different users. I tried creating a mailing list called "onstream" inside $HOME/.mailrc but it didn't seem to like it. Could you possibly let me know the exact syntax to do this please ?

Once again , thanks very much for your help it is very much appreciated !! :-)
Steven E. Protter
Exalted Contributor

Re: mailx corrupting file when sent to lotus notes account

Sorry about the idiosyncries of my script.

For reasons where the script was developed we had to pretty much require the same information twice.

If you want to attach a file called schmo.txt and it sits in /tmp you have to put it on the command line twice.

once as schmo.txt

once as /tmp/schmo.txt

Its totally a JUF thing and I don't work there any more so some day I'll change the script.

Feel free to modify it yourself. The mail attachment code needs the full path to know where to get the file. I guess its pretty stupid coding, but it was the best I could do in the time alloted three years ago.

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