I’ve meant to set up email from emacs for a while, but only recently got around to setting it up. I use GMail, so I’d wanted email sent from emacs to appear as being sent from my gmail account. To do this, you must install the ’starttls’ program. On Ubuntu, this can be done with ’sudo apt-get install starttls’. Once that is done, put the following in your .emacs file:
(setq send-mail-function 'smtpmail-send-it message-send-mail-function 'smtpmail-send-it smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) smtpmail-auth-credentials (expand-file-name "~/.authinfo") smtpmail-default-smtp-server "smtp.gmail.com" smtpmail-smtp-server "smtp.gmail.com" smtpmail-smtp-service 587 smtpmail-debug-info t) (require 'smtpmail)
You will also need to create a ~/.authoinfo file with the following format:
machine smtp.gmail.com login email@example.com password secret
Once you add these customizations, you will be able to use ‘C-x m’ in order to create an email and send it to people. However, this does not allow you to read and reply to email from emacs. Unfortunately, I haven’t found a great solution for that yet; I tried using GNUs a while ago and didn’t like it, but if you want to try it the information on how to do so is located on the emacs-wiki. The other option that I sometimes use is to have a w3m buffer open and pointing to Gmail, but w3m isn’t as good as I would like and so this isn’t the best experience either. Let me Please let me now if you know of a better way to handle mail from emacs.