LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   How attach a file using /usr/lib/sendmail (https://www.linuxquestions.org/questions/solaris-opensolaris-20/how-attach-a-file-using-usr-lib-sendmail-4175475156/)

sras 08-29-2013 07:07 AM

How attach a file using /usr/lib/sendmail
 
Hello Guys,

I am trying to attach a file while sending an email from the server (Solaris OS).

Getting the error "uuencode: not found"

Could you advise on this?

Using the command below in my script:

{
echo "SUBJECT:File Count"
echo "FROM:server name"
echo "TO:emailadd@test.com"
echo "Find attached file count"
uuencode /home/user/count_file.csv count_file.csv
} | /usr/lib/sendmail -t

thanks.

sras 08-29-2013 07:11 AM

Quote:

Originally Posted by sras (Post 5018171)
Hello Guys,

I am trying to attach a file while sending an email from the server (Solaris OS).

Getting the error "uuencode: not found"

Could you advise on this?

Using the command below in my script:

{
echo "SUBJECT:File Count"
echo "FROM:server name"
echo "TO:emailadd@test.com"
echo "Find attached file count"
uuencode /home/user/count_file.csv count_file.csv
} | /usr/lib/sendmail -t

thanks.

Just looking for any other alternative command to attach a file..

thanks.

shivaa 08-29-2013 10:50 AM

Which version of Solaris you're using? You might not using full path of the command (it should be in /usr/bin/uuencode)? Can you check:
Code:

~$ which uuencode
~$ whereis uuencode

You can then try folllowing in your script:
Code:

/path/to/uuencode  /path/to/foo.txt<space>foo.txt | mailx -s "<subject>" abc@xyz.com
OR
/usr/bin/uuencode  /path/to/foo.txt<space>foo.txt | mailx -s "<subject>" abc@xyz.com


sras 08-30-2013 03:11 AM

"uuencode" is not installed in the server.

Tried after installing it..it is working fine now.

thanks.


All times are GMT -5. The time now is 11:47 AM.