使用mailx命令发送邮件时收到退信的解决咨询
解决mailx发送邮件后收到无效地址退信的问题
你的问题根源在于命令里多了一个多余的-,这个符号被mailx当成了收件人地址,服务器尝试投递到不存在的-@node.server.example.com,所以产生退信。
直接修改命令,移除那个多余的-即可:
echo "This is the body of the email. There is stuff here. Thank you for reading this. Team Member" | mailx -r teammail@example.com -s "Email Subject" -a "filename.csv" email1@example.com email2@example.com email3@example.com
额外说明
部分mailx版本允许用-指定从标准输入读取邮件正文,但这个参数需要放在收件人列表之前。如果你的环境确实需要这个参数,调整后的命令应该是:
echo "This is the body of the email. There is stuff here. Thank you for reading this. Team Member" | mailx -r teammail@example.com -s "Email Subject" -a "filename.csv" - email1@example.com email2@example.com email3@example.com
不过从你的退信情况来看,当前环境下这个-被解析成了收件人,所以直接移除是最稳妥的方案。
内容的提问来源于stack exchange,提问作者Sotark
相关产品推荐
相关产品推荐

