郵件命令掛在「副本:」郵件上

郵件命令掛在「副本:」郵件上

由於某種原因,當我發送郵件時, 按下回車鍵後 它會列印出來,但我無能為力。我試著按了一下,還是卡住了。我正在嘗試在 Ubuntu 上設定 Amazon SESmail -s 'test email' [email protected]Cc:.

答案1

它沒有掛。它正在等待您輸入訊息。通常您可以發送命令列電子郵件,例如:

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

但如果您只是這樣做,下一部分將是或抄送電子郵件。如果沒有,只需按 Enter 鍵。mail -s 'test email' [email protected]Cc:

然後只需在要傳送的訊息中輸入任何正文,完成後立即按Enter,然後按Ctrl+D發送訊息。

希望這可以幫助!

答案2

您可以將 '< /dev/null' 放在命令末尾,如下所示:

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

它會在沒有任何正文的情況下發送您的訊息。

相關內容