Mailbox显示发件人姓名为"Apache",因为我自动发送的邮件是从Perl CGI程序发送的。如何将其更改为其他内容?
发布于 2011-06-30 23:44:41
您只需要添加一个From:
标头。默认情况下没有。
echo "Test" | mail -a "From: Someone <someone@example.com>" other@example.com
您可以使用-a
添加任何自定义标头
echo "Test" | mail -a "From: Someone <someone@example.com>" \
-a "Subject: This is a test" \
-a "X-Custom-Header: yes" other@example.com
发布于 2012-07-26 02:44:27
mail -s "$(echo -e "This is the subject\nFrom: Paula <johny@paula.com>\n
Reply-to: 1232564@yourserver.com\nContent-Type: text/html\n")"
milas.josh@gmail.com < htmlFileMessage.txt
上面是我的solution..just用你想要的任何名字替换"Paula“例如Johny Bravo..any可以在from和reply之前添加额外的头to...just在添加them....this之前确保你知道你的头的语法对我来说很好。
发布于 2015-05-14 14:08:15
您可以使用"-r“选项来设置发件人地址:
mail -r me@example.com -s ...
如果您还想在from字段中包含真实姓名,可以使用以下格式
mail -r "me@example.com (My Name)" -s "My Subject" ...
https://stackoverflow.com/questions/6537297
复制相似问题