BruceBlog

Sunday, November 29, 2009

Sending mail with Emacs - take 2

Sending mail with Emacs - take 2

My post yesterday describes how to setup Emacs to send mail using the
Gnus mail facility. I've simplified that setup somewhat, and it works
with the message-mail function.

I got rid of the .gnus.el file (since I won't be starting gnus anymore)
and put these lines in my .emacs file:

;;;; Start mail setup lines
(setq message-send-mail-function 'message-send-mail-with-sendmail)
;; we substitute sendmail with msmtp
(setq sendmail-program "C:/Program Files/gnu/msmtp/msmtp.exe")
;;need to tell msmtp which account we're using
(setq message-sendmail-extra-arguments '("-a" "user"))
;; you might want to set the following too
(setq mail-host-address "gmail.com")
(setq user-full-name "My Name")
(setq user-mail-address "user@gmail.com")
(setq sendmail-program "C:/Program Files/gnu/msmtp/msmtp.exe")
;;;; End mail setup lines

You need to substitute appropriately for your email account. It should
work with SMTP servers other than gmail's, also.

Refer to yesterday's post to see how to setup the msmtp program, and
where to find it.

0 Comments:

Post a Comment

<< Home