From: Leo Butler <Leo.Butler@umanitoba.ca>
To: Alessandro Bertulli <alessandro.bertulli96@gmail.com>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: Problem with TLS when sending emails
Date: Wed, 11 May 2022 15:34:12 +0000 [thread overview]
Message-ID: <87k0as6q30.fsf@t14.reltub.ca> (raw)
In-Reply-To: <CAJczNmCM2aJHrRfdsV7efmfFk3NTK0tpAF4qUh-rLAKxB1uOpA@mail.gmail.com> (Alessandro Bertulli's message of "Wed, 11 May 2022 15:28:18 +0200")
On Wed, May 11 2022, Alessandro Bertulli <alessandro.bertulli96@gmail.com> wrote:
> Hi all.
> I was trying to set up my Gmail configuration to send emails from
> Emacs. However, I encounter a problem with TLS.
>
> 1) I set up a file ~/.authinfo.gpg, where I put
>
> machine imap.gmail.com login alessandro.bertulli96@gmail.com password
> -pswd- port 993
> machine smtp.gmail.com login alessandro.bertulli96@gmail.com password
> -pswd- port 587
>
> Note that "-pswd-" is actually the 16 char long app password generated
> by Gmail, required to use external clients.
>
> 2) My init file contains
>
> (setq user-full-name "Alessandro Bertulli"
> user-mail-address "alessandro.bertulli96@gmail.com")
> (setq smtpmail-smtp-server "smtp.gmail.com"
> smtpmail-smtp-service 587
> smtpmail-stream-type 'ssl
> smtpmail-debug-info t)
> ;; Configure the function to use for sending mail
> (setq message-send-mail-function 'smtpmail-send-it)
I have exactly the same configuration for gmail, except
smtpmail-stream-type is nil (which according to the documentation, means
the connection is upgraded with starttls if possible). That works fine.
I have not tried Robert Pluim's suggestion to use port 465.
Note that you can use `gnus-posting-styles' to insert the correct
smtpmail information into your email, when mailing from Gnus (I have
never used C-x m outside of Gnus).
E.g. (assuming your nnimap server is named GoogleMail)
#+begin_src emacs-lisp
(setq gnus-posting-styles '(
("GoogleMail:.+"
(address "SomeOne@gmail.com")
(X-Message-SMTP-Method "smtp smtp.gmail.com 587 SomeOne@gmail.com"))))
#+end_src
This is handy if you are managing multiple email accounts within Gnus.
Leo
next prev parent reply other threads:[~2022-05-11 15:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-11 13:28 Problem with TLS when sending emails Alessandro Bertulli
2022-05-11 13:44 ` Robert Pluim
2022-05-11 15:34 ` Leo Butler [this message]
2022-05-11 15:44 ` Robert Pluim
-- strict thread matches above, loose matches on Subject: below --
2022-05-11 16:20 Alessandro Bertulli
2022-05-11 16:28 ` Robert Pluim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k0as6q30.fsf@t14.reltub.ca \
--to=leo.butler@umanitoba.ca \
--cc=alessandro.bertulli96@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.