Saturday, February 7, 2009

Sending email via gmail in emacs

I got this working in linux, and it's fairly easy. I'm still trying to get it working on my win32 machines, and I'll post about that later if I get it working.

This post has most of the details I needed:

So I put the following in my .emacs

; install starttls from here (no need for patch)

(setq send-mail-function 'smtpmail-send-it
message-send-mail-function 'smtpmail-send-it
'(("" 587 nil nil))
(expand-file-name "~/.authinfo")
smtpmail-default-smtp-server ""
smtpmail-smtp-server ""
smtpmail-smtp-service 587
smtpmail-debug-info t
starttls-extra-arguments nil
smtpmail-warn-about-unknown-extensions t
starttls-use-gnutls nil)

And followed the instructions to make the .authinfo file containing:

machine login [your name] password [your password]

And finally download, unzip, make and install startttls:

You don't need to apply the patch there, it works without as far as I can tell.

Finally you can create and send mail.


sivaram said...

On win32 you could do it this way


Justin said...

Thanks that does work. I had to make one small change to their instructions, and I've made a new post about it. Do you know how to fix having your password in plaintext in the config file?