Arj*_*kar 68
通常,mutt From:根据您在以下位置设置的from配置变量设置标头~/.muttrc:
set from="Fubar <foo@bar>"
Run Code Online (Sandbox Code Playgroud)
如果未设置,mutt则EMAIL默认使用环境变量.在这种情况下,你可以在命令行上调用mutt这样的东西(而不是你在评论中如何显示):
EMAIL="foo@bar" mutt -s '$MailSubject' -c "abc@def"
Run Code Online (Sandbox Code Playgroud)
但是,如果您希望在编写时能够编辑From:标题,则需要配置mutt为允许您首先编辑标题.这包括在您的~/.muttrc:中添加以下行:
set edit_headers=yes
Run Code Online (Sandbox Code Playgroud)
之后,下次打开mutt并编写电子邮件时,会弹出包含标题的所选文本编辑器,以便您编辑它们.这包括From:标题.
lua*_*nyi 25
如果您只想更改一次,可以在命令行中指定"from"标题,例如:
mutt -e 'my_hdr From:obama@whitehouse.org'
Run Code Online (Sandbox Code Playgroud)
my_hdr 是mutt提供自定义标头值的命令.
最后一句话,不要做坏事!
reo*_*eox 22
在发送电子邮件之前,您可以按<ESC> f(Escape后跟f)更改From:地址.
约束:这只有在curses模式下使用mutt并且不想编写脚本或者想要永久更改地址时才有效.然后其他解决方案更好!
puz*_*ent 10
一个特例就是如果你在〜/ .muttrc中使用了类似下面的结构:
# Reset From email to default
send-hook . "my_hdr From: Real Name <email@example.com>"
Run Code Online (Sandbox Code Playgroud)
这个send-hook将覆盖以下任何一个:
mutt -e "set from=email@example.com"
mutt -e "my_hdr From: Other Name <otheremail@example.com>"
Run Code Online (Sandbox Code Playgroud)
您的电子邮件仍会显示标题:
From: Real Name <email@example.com>
Run Code Online (Sandbox Code Playgroud)
在这种情况下,我发现的唯一命令行解决方案实际上是覆盖了send-hook本身:
mutt -e "send-hook . \"my_hdr From: Other Name <otheremail@example.com>\""
Run Code Online (Sandbox Code Playgroud)
小智 6
对于一次性更改,您可以这样做:
出口EMAIL='sender@somewhere.com'; mutt -s"Elvis is dead"receiver@somewherelse.com
| 归档时间: |
|
| 查看次数: |
89157 次 |
| 最近记录: |