Score:10

The mail command hangs on "Cc:" for mail

ph flag

For some reason, when I send mail with mail -s 'test email' [email protected] It prints out Cc: after I press enter and I can't do anything. I tried pressing . and it still is stuck. I'm trying to setup Amazon SES on Ubuntu

Soren A avatar
mx flag
Have you tried to press Enter ?
raj avatar
cn flag
raj
Don't use the `mail` program. There's no need to. If you want to send mail by a human user, use "real" email client like `mutt`. If you want to send mail programatically from script, use `/usr/sbin/sendmail`, as `mail` internally does. In both cases the `mail` program is unneeded.
Score:26
id flag

It is not hung. It is waiting for you to type in your message. Normally you can just send a command line email like:

echo "This is a test message" | mail -s 'test email' [email protected]

But if you just do mail -s 'test email' [email protected] the next part will be the Cc: or Carbon Copy email. If none, just press Enter.

Then just type in whatever body to the message you want to send, then as soon as you are done press Enter, then press Ctrl+D to send the message.

Hope this helps!

Score:1
no flag

You can just put '< /dev/null' ate the end of your command like this:

mail -s 'test email' [email protected] < /dev/null

It will send your message without any body.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.