This is an in-progress guide for setting up Emacs (Doom Emacs) to send email from your personal Google (Gmail) user account.

As of [2024-02-12 Mon], the best I can figure is:

  • Configure smtpmail

     smtpmail-smtp-server ""
     smtpmail-smtp-service 587
     smtpmail-smtp-user "")
  • Set up xoauth2 as an auth-source (a)

    I think it’d be nice to integrate emacs-oauth2-auto (a) to handle pulling new refresh tokens and release the whole thing as a gmail-focused package, similar to org-gcal.el (a).

     send-mail-function 'smtpmail-send-it
     auth-source-xoauth2-creds ""
     auth-source-xoauth2-use-curl t)
    (add-to-list 'smtpmail-auth-supported 'xoauth2)