Nol*_*nig 16
该选项-a填充标题。
快速命令:
mail -a FROM:sender@my-domain.com recipient@another-domain.fr
Run Code Online (Sandbox Code Playgroud)
长命令
mail --append="FROM:sender@my-domain.com" recipient@another-domain.fr
Run Code Online (Sandbox Code Playgroud)
Run Code Online (Sandbox Code Playgroud)Usage: mail [OPTION...] [address...] -a, --append=HEADER: VALUE append given header to the message being sent -A, --attach=FILE attach FILE --content-type=TYPE set content type for subsequent --attach options -e, --exist return true if mail exists --encoding=NAME set encoding for subsequent --attach options -E, --exec=COMMAND execute COMMAND -F, --byname save messages according to sender -H, --headers write a header summary and exit -i, --ignore ignore interrupts -n, --norc do not read the system mailrc file -N, --nosum do not display initial header summary -p, --print, --read print all mail to standard output -q, --quit cause interrupts to terminate program -r, --return-address=ADDRESS use address as the return address when sending mail -s, --subject=SUBJ send a message with the given SUBJECT -t, --to precede message by a list of addresses -u, --user=USER operate on USER's mailbox常用选项
Run Code Online (Sandbox Code Playgroud)--config-file=FILE, --rcfile=FILE load this configuration file --config-help show configuration file summary --config-lint, --rcfile-lint check configuration file syntax and exit --config-verbose, --rcfile-verbose verbosely log parsing of the configuration files --no-site-config, --no-site-rcfile do not load site configuration file --no-user-config, --no-user-rcfile do not load user configuration file --set=PARAM=VALUE set configuration parameter --show-config-options show compilation options全局调试设置
Run Code Online (Sandbox Code Playgroud)--debug-level=LEVEL set Mailutils debugging level --debug-line-info show source info with debugging messages -?, --help give this help list --usage give a short usage message -V, --version print program version对于任何相应的短选项,长选项的强制性或可选参数也是强制性或可选的。
lcd*_*047 15
尝试这个:
mail -s 'Some Subject' -r 'First Last <you@example.com>' recipient@example.net
Run Code Online (Sandbox Code Playgroud)
这将设置From:和信封发件人。
这取决于您使用的是哪个邮件客户端。某些 Linux 发行版链接到mailx您可以使用该-r from-addr参数的位置。
如果你有 mutt 你应该可以使用mutt -e "set from='name <name@somewhere>'>.
具有该mail命令的其他发行版应该能够使用echo "test"|mail -s "subject" address@recipient.com -- -f from@address.