Two easy ways to do this:
1) ncftput (it is part of the ncftp package)
I think it does exactly what you need.
2) use netcat:
cat $FTP_SCRIPT | netcat $HOST 21
The $FTP_SCRIPT should be the name of a file, containing:
You can embed the contents of this file in your script as a single string and do:
echo $FTP_STRING | netcat $HOST 21
but then you have to embed CRLF characters in your string. That can be awkward to do sometimes, especially if you use joe as editor.
Method 1 is the best for simple problems.