Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attach txt file from unix to lotus notes email in script

Status
Not open for further replies.

confuseddddd

Programmer
May 22, 2003
53
US
Hello,
Have created a script that is to attach a text file into an email but don't think I have it coded correctly:

#!/bin/ksh
scp username@abc.com:/directory_where_file_is /tmp

if [ -e /tmp/filename.txt ];
then
uuencode /tmp/filename.txt attached_filename.txt | mail -s "Your file is attached" someone@somewhere.com
else
mail -s "Caution !! file was not available to send" username@abc.com
fi

I also tried to use cat as well but this put the contents of the file into the email and I am going to have large files so this won't work either.

cat $TRANSLOG | sendmail -f run.newtran@servername.com "someone@somewhere.com"

Any help would be great.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top