How can I change the sender's name or e-mail address (From:
header) used by mutt
?
相关问题
- Why should we check WIFEXITED after wait in order
- UNIX Bash - Removing double quotes from specific s
- bash delete line condition
- Trying to make a permanent Alias - UNIX
- Generating signed XPI via jpm failed
If you just want to change it once, you can specify the 'from' header in command line, eg:
my_hdr
is mutt's command of providing custom header value.One last word, don't be evil!
One special case for this is if you have used a construction like the following in your ~/.muttrc:
This send-hook will override either of these:
Your emails will still go out with the header:
In this case, the only command line solution I've found is actually overriding the send-hook itself:
100% Working!
To send HTML contents in the body of the mail on the go with Sender and Recipient mail address in single line, you may try the below,
File: body_html.html
Note: Tested in RHEL, CentOS, Ubuntu.
for a one time change you can do this:
export EMAIL='sender@somewhere.com'; mutt -s "Elvis is dead" receiver@somewherelse.com
before you send the email you can press
<ESC> f
(Escape followed by f) to change theFrom:
Address.Constraint: This only works if you use mutt in curses mode and do not wan't to script it or if you want to change the address permanent. Then the other solutions are way better!
Normally, mutt sets the
From:
header based on thefrom
configuration variable you set in~/.muttrc
:If this is not set,
mutt
uses theEMAIL
environment variable by default. In which case, you can get away with calling mutt like this on the command line (as opposed to how you showed it in your comment):However, if you want to be able to edit the
From:
header while composing, you need to configuremutt
to allow you to edit headers first. This involves adding the following line in your~/.muttrc
:After that, next time you open up mutt and are composing an E-mail, your chosen text editor will pop up containing the headers as well, so you can edit them. This includes the
From:
header.