What you are probably looking for is the following style of writing it (equivalent to other methods)
write $user <<EOF
message here
as opposed to the
echo "asd" | write $user
method, using here-doc redirection transparently allows multiple lines
and reads everything until seeing the delimiter
so the sent message end here:
EOF
Note: you are not directly "sending an EOF" here, the shell just understands the word "EOF" as your chosen mark of ending the input and will end the input there - and write doesnt ask you to press ctrl+d in this case, because it is reading from the stuff the shell is piping to it.
Note 2: You may find useful knowing that pretty much every comand-line tool in the unix world allows for this kind of default shell tricks, as they are only relying on the incredibly universal concept of stdin - write, as many other tools, will read from what is piped to it - and only ask the user interactively for input if none such is present and a user input method would make sense.
For more info, there is a question asking for exactly this over here: https://stackoverflow.com/questions/2500436/how-does-cat-eof-work-in-bash