It does not hang, it is normal behaviour of mail command
it waits for user input so you can type your message
you end your message by typing ctrl-d
Also if you want use it in a script, try :
Code:
cat <<END | mail -s "Server Problem $HOST $DATE" $MAIL
server: $HOST
date: $DATE
add more...
END