Xref: utzoo gnu.emacs.help:632 comp.emacs:9776 Path: utzoo!attcan!utgpu!watserv1!watmath!uunet!bu.edu!spdcc!mintaka!yale!cs.utexas.edu!tut.cis.ohio-state.edu!BIGBIRD.BU.EDU!jbw From: jbw@BIGBIRD.BU.EDU (Joe Wells) Newsgroups: gnu.emacs.help,comp.emacs Subject: How to add a mail header field via .emacs Message-ID: <9012200707.AA10501@bigbird.bu.edu> Date: 20 Dec 90 07:07:25 GMT Sender: daemon@tut.cis.ohio-state.edu Followup-To: gnu.emacs.help Organization: Gatewayed from the GNU Project mailing list help-gnu-emacs@prep.ai.mit.edu Lines: 27 I'd like to add "Return-Receipt-To: " header field to my mail template. Can I do this in my .emacs (I already know about CC, BCC, etc.)? If so, please *mail* me the lisp code for it. Thank you. Well, of course you can always simply type in any headers you want. But if you want to define a command to do the work for you, it goes roughly like this: (defun mail-return-receipt-to () "Move point to end of Return-Receipt-To-field. Create a Return-Receipt-To field if none. Then add the user's login name." (interactive) (expand-abbrev) (save-excursion (or (mail-position-on-field "Return-Receipt-To" t) (progn (mail-position-on-field "to") (insert "\nReturn-Receipt-To: "))) (or (eq ? (preceding-char)) (insert ", ")) (insert (user-login-name)))) (define-key mail-mode-map "\C-c\C-f\C-r" 'mail-return-receipt-to) -- Enjoy, Joe