all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philipp Haselwarter <philipp.haselwarter@gmx.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Gnus: How to easily change "From:" from the default to a second	account's address?
Date: Fri, 25 Nov 2011 03:17:02 +0100	[thread overview]
Message-ID: <87bos10wv5.fsf@nzebook.haselwarter.org> (raw)
In-Reply-To: 5BBBF1D0-1349-4C17-8D38-F75CE52D2C53@math.ethz.ch

I often find myself wanting to change the From: after opening the
message; this allows picking one of your accounts:

#+begin_src emacs-lisp
(defcustom my-smtp-accounts nil
  "*list of available smtp accounts"
  :group 'smtpmail
  :type '(repeat alist))

(defun my-pick-smtp ()
  (interactive)
  (setq user-mail-address
        (let ((f (if (functionp 'ido-completing-read)
                     'ido-completing-read
                   completing-read)))
          (funcall f "Which smtp acc:" (mapcar 'cadr my-smtp-accounts))))
  (save-excursion
    (save-restriction
      (message-narrow-to-headers-or-head)
      (message-remove-header "From")
      (goto-char (point-max))
      (insert "From: " (message-make-from) "\n"))))

#+end_src

-- 
Philipp Haselwarter




  reply	other threads:[~2011-11-25  2:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 16:24 Gnus: How to easily change "From:" from the default to a second account's address? Marius Hofert
2011-11-23 16:35 ` Tassilo Horn
2011-11-23 22:17   ` Marius Hofert
2011-11-25  2:17     ` Philipp Haselwarter [this message]
2011-11-25  3:12       ` Eric Abrahamsen
2011-11-26 12:03         ` Philipp Haselwarter
2011-11-27  1:52           ` Eric Abrahamsen
2011-12-03 21:10             ` Johnny
2011-12-03 22:53               ` Philipp Haselwarter
2011-12-04 12:58                 ` Harry Putnam
2011-12-05 19:44                   ` Richard Riley
2011-12-05 20:18                     ` Johnny
2011-12-05 20:39                       ` Richard Riley
2011-12-05 20:58                         ` Johnny
2011-11-27 19:03 ` Memnon Anon
2011-12-03 19:17 ` Teemu Likonen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bos10wv5.fsf@nzebook.haselwarter.org \
    --to=philipp.haselwarter@gmx.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.