大网数据广告活动
服务器运维问答

mailx Not Sending Email

· 52CE 我爱测

I installed mailx in my Linux webserver running CentOS 7. When I try to send a test email, echo "Body test." | mail -r "[email omitted]" -s "Subject Test" [email omitted] I check my email and don't receive anything. However, if I…

问题原文

原帖链接 · GTS Joe · CC BY-SA 3.0

I installed mailx in my Linux webserver running CentOS 7. When I try to send a test email,

echo "Body test." | mail -r "[email omitted]" -s "Subject Test" [email omitted]

I check my email and don't receive anything. However, if I use the mailq command, I get this:

postqueue: warning: Mail system is down -- accessing queue directly
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
7805D2DF        422 Wed Jan 11 15:00:40  [email omitted]
                                         [email omitted]

已采纳解答

原帖链接 · Jacob Evans · CC BY-SA 3.0

mailx is a client, you still need an MTA like postfix/sendmail/exim, or specify a server

$ mailx -v -s "$EMAIL_SUBJECT" \
-S smtp=smtp://smtp.ust.hk \
-S from="$FROM_EMAIL_ADDRESS($FRIENDLY_NAME)" \
$TO_EMAIL_ADDRESS

source

Another Example

(options vary but I think this is right for rhl)

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-01-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。