linux 下發送郵件
1安裝 postfix
2啓動 postfix
service postfix start
3使用mail命令發送郵件
mail -s 郵件標題 郵件地址
輸入郵件內容 Ctrl+D結束
給本身郵箱發郵件
mail -s 這是一個測試 XXXXX@qq.com
給同主機的其餘賬號發郵件
mail -s 郵件標題 用戶名@localhost
發送
[user@centos ~]$ mail -s 「郵件標題」 root@localhost
hello root
EOT
[user@centos ~]$
接受
[root@centos ~]# mail
Heirloom Mail version 12.4 7/29/08. Type ? for help.
"/var/spool/mail/root": 7 messages 1 new
1 user@localhost.local Sat Nov 26 16:50 17/701 "*** SECURITY informat"
2 user@centos.localdom Sun Dec 11 21:09 17/709 "*** SECURITY informat"
3 test@centos.localdom Thu Dec 22 13:56 17/652 "*** SECURITY informat"
4 test@centos.localdom Tue Jan 3 20:16 17/705 "*** SECURITY informat"
5 root Fri Mar 23 02:59 19/615 "jaksndkjwfd"
6 user Fri Mar 23 03:22 20/652 "TTTTTTTTTTTTTTTTTTTTT"
>N 7 user Fri Mar 23 03:39 18/650 "「郵件標題」"
& 7
Message 7:
From user@zhaoming200808.xicp.net Fri Mar 23 03:39:34 2012
Return-Path: <user@zhaoming200808.xicp.net>
X-Original-To: root@localhost Delivered-To: root@localhost.localdomain Date: Fri, 23 Mar 2012 03:39:34 +0800 To: root@localhost.localdomain Subject: 「郵件標題」 User-Agent: Heirloom mailx 12.4 7/29/08 Content-Type: text/plain; charset=us-ascii From: user@zhaoming200808.xicp.net (user) Status: R hello root 若是能看到郵件 成功
歡迎關注本站公眾號,獲取更多信息