Put the following in ~/.profile : export EMAIL="<EMAIL_ADDRESS>" export NAME="<FULL NAME>" export SMTPSERVER="smtp.gmail.com" For example, if your name is John Smith and your email address is johnsmith@gmail.com: export EMAIL="johnsmith@gmail.com" export NAME="John Smith" export SMTPSERVER="smtp.gmail.com" Now put the following in your ~/.gnus file: (setq gnus-select-method '(nnimap "gmail" (nnimap-address "imap.gmail.com") ; it could also be imap.googlemail.com if that's your server. (nnimap-server-port "imaps") (nnimap-stream ssl))) (setq smtpmail-smtp-service 587 gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]") Put the following in your ~/.authinfo file, replacing <USER> with your email address and replacing <PASSWORD> with your password—or your application-specific password: machine imap.gmail.com login <USER> password <PASSWORD> port imaps machine smtp.gmail.com login <USER> password <PASSWORD> port 587
setq smtpmail-smtp-service 587 smtpmail-smtp-server "smtp.gmail.com" message-send-mail-function 'smtpmail-send-it starttls-extra-arguments nil starttls-gnutls-program "/usr/bin/gnutls-cli" starttls-extra-arguments nil starttls-use-gnutls t gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\"]\"[#'()]") (with-eval-after-load 'gnus-group (gnus-group-list-all-groups 5))