ken bohnenkamp
31st August 2014, 23:53
I am using a utility called nail to create an email with an attachment. The unix command I am using in a baan script is as follows:

shell("nail -s Fin -a /home/kgb1test/filea.pdf ken_bohnenkamp@andersonsinc.com </dev/null", 1)

The email does have the email attachment, but everytime I open the pdf in the attachment, it shows as being blank. If I open the pdf from the unix server, it shows the report data without issue. Why does it show as blank in the attachment ? Any help would be appreciated. :confused:

bhushanchanda
2nd September 2014, 14:30
Hi,

How are you opening , writing and closing the file? Check if you are closing the file before sending it.

mark_h
2nd September 2014, 15:25
Bhushan has a good suggestion. My question is have you tried the command from the unix prompt itself? Maybe shell out and run it yourself manually - make sure the file is there and readable by the user-id running the nail command. See if maybe you get any errors.

NPRao
3rd September 2014, 00:36
shell("nail -s Fin -a /home/kgb1test/filea.pdf ken_bohnenkamp@andersonsinc.com </dev/null", 1)

The issue is that you are redirecting the /dev/null as input into the email so its blank.
I looked up the nail usage and here is more info -
nail - This is a newer MUA recently brought to my attention. You can define outgoing MIME types beyond text/plain and application/octet-stream by using extensions and defining those in ~/.mime.types or a system-wide file.
nail -s "$SUBJECT" -a $ATTFILE $MAILTO < $TXTFILE