0 {7 z- W+ B' ^- A7 ?) r$ M( o# mail -s "This is a test" [email protected] < content.txt 8 y z6 l t/ R" K, u編輯模式寄出: 8 }1 Q; ~ [% ?' S F4 l1 C; u# mail [email protected] ; m1 ?3 |5 |5 PSubject: This is a test mail8 o# ^) o& C1 I/ {
There are writing area! & @" Y! g5 u$ u1 _$ R3 o S( hYou can't use the Up/Down button in this form... . x# i+ c( e7 t* Y' n# h ~you can finish with "." 2 R- ~0 n5 {6 q. <==這個『.』就是結束符號!要正常離開編輯畫面就是 . !& x4 E0 n5 I. d& @3 c
, z2 v8 m; w6 d- q+ J7 X% Nmail/mailx命令使用外部SMTP來發送郵件. \1 o! E- p) G0 h6 ^6 b% h t L) j% {3 q
/bin/mail會默認使用本地sendmail發送郵件,這樣本地的機器必須安裝和啟動Sendmail服務,配置非常麻煩,而且會帶來不必要的資源佔用。而通過修改配置文件可以使用外部SMTP服務器,可以達到不使用sendmail而用外部的SMTP服務器發送郵件的目的: 0 }8 Z, r% ]+ o: y* S1 |修改/etc/mail.rc 加入底下設定: 4 n. l" L' z8 V