If you mean that you started an email with the mail command, typed your message and then wanted to exit the mail command, try typing a '.' by itself on a line and pressing the return key. The mail should respond with an EOT and exit. Here's an example:
Code:
$ mail -s 'Test message' oracle
Here's a test message
.
EOT