1

How to sent mail from emacs?

I found this

There are two ways to send the message. C-c C-s (mail-send) sends the message and marks the mail buffer unmodified, but leaves that buffer selected so that you can modify the message (perhaps with new recipients) and send it again. C-c C-c (mail-send-and-exit) sends and then deletes the window or switches to another buffer

But both ( ctrl+c ctrl+s ) and (ctrl-c crtl+c) are not working

3
  • Are you talking about sending mail from mutt using emacs as an editor (in which case you need to return to mutt to send the email) or sending mail using emacs as the email client?
    – Quentin
    Apr 1, 2010 at 9:49
  • 1
    @dorward: either way, this is not an SF question. An SF question would need details of the MTA to be answerable. Apr 1, 2010 at 10:58
  • remember that emacs has to be in mutt-mode for the bindings to work
    – Steen
    Feb 21, 2013 at 9:25

3 Answers 3

4

If you've invoked Emacs as Mutt's message composer, then you don't want to send the message from Emacs, so ignore what Emacs tells you about how to send a message.

Instead, you want to exit the editor (C-x C-c) to return to Mutt with the now-composed message.

Alternatively, use one of the many MUAs that are provided with Emacs (I recommend Gnus or Wanderlust) so you don't have to keep going into and out of the editor.

1
  • I've found that sending from Emacs isn't a particularly painful way to go in this situation (as long as Emacs is set up to send mail). Perhaps the take-home message is that, in this case, there are a variety of ways to lean on Mutt and Emacs to get the job done...
    – thomp45793
    Feb 22, 2021 at 3:51
2

mail-send and mail-send-and-exit are not related with mutt, but with pure emacs way to send email.

If you want to use mutt+emacs you will want to:

  • use emacs-server: add (server-start) somewhere in you .emacs and launch emacs so it will be availaible for emacsclient
  • set EDITOR to 'emacsclient --alternate-editor ""', adding

     export EDITOR='emacsclient --alternate-editor ""'
    

    in your .bashrc will do, or configure mutt to use this as its editor (I don't know how).

  • once all this is done, mutt will use emacsclient for editing a message, emacslient will connect to an existing emacs if there is one, or launch a new one if there is none with your message in it
  • you will have to use C-x # once your message is edited, for mutt to continue its work and send the message.
1
  • Note that you can also set the editor variable in your mutt configuration: ~set editor="emacsclient -nw". I also recommend to use ~post.el~, as it is perfectly suited to edit emails that are to be sent via mutt: post-mode.sourceforge.net Nov 27, 2018 at 15:11
0

Is Emacs started by mutt? I used to use mutt with vim and IIRC, I had to save and close vim with :wq when I wanted to send the message, maybe you have to do so either.

1
  • yes..emacs is started with mutt.
    – lakshmipathi
    Apr 1, 2010 at 9:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .