5

It's been almost two years since the question was asked, but I have just had the same problem and I managed to solve it using the smtpmail-smtp-user variable. In the manual it says: If the variable smtpmail-smtp-user is set to a non-nil value, then only entries for that user are considered. In my personal context vars I have: (smtpmail-smtp-user . "...


5

I know nothing about mail in Emacs, but running C-h k C-x m tells me that C-x m runs the command compose-mail, which is different from mail. This is presumably why they behave differently. You can find out more with C-h f compose-mail and C-h f mail.


3

I found a solution! I had to tell it where to find gnutls. (setq message-send-mail-function 'smtpmail-send-it smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) smtpmail-auth-credentials '(("smtp.gmail.com" 587 "email@example.com" nil)) smtpmail-default-smtp-server "smtp.gmail.com" smtpmail-smtp-server "smtp.gmail.com" ...


3

The auth-source lookup done by smtpmail uses the smtpmail-smtp-service port as well, so you need to specify '587' in .authinfo.gpg (although personally I advocate for using port 465 and a stream-type of 'tls).


2

Apart from the variables listed in your question, have a look at smtpmail-smtp-service, which specifies the port number that the SMTP server is reachable at. The default value of this variable is 25, but nowadays many SMTP servers use port 587 instead. The SMTP protocol is used for two different use cases: mail servers relaying a message in the direction ...


2

The problem was resolved by simply adding client=yes under ssmtp in stunnel.conf


1

"smtp.zenbox.pl" wants the machine from which you're sending mail to have a fully qualified domain name. You can arrange for that either by making sure that (system-name) returns one, or by setting smtpmail-local-domain to an appropriate value.


1

I had set the variable smtpmail-smtp-user to my name instead of my email ID. Correcting it got rid of the error. Thanks to @rpluim for helping me debug the issue.


1

Turns out I had the email address I was using as a test recipient set up as an extra "Send email as" account in Gmail.


1

Is a network connection to this server possible? Try: telnet an.smtp.server 25 from command line (like bash). If you do not get an answer from the server, then emacs is not the reason and you have to search for the problem in firewall settings, router settings, operating system or even hardware.


1

There is an accepted answer to a similar question. Extracted information: yes, you can if you use Gnus. See above mentioned answer for instructions.


1

You have hopefully figured this out by now but I think you need (setq smtpmail-stream-type 'starttls). You've specified TLS directly which won't work if the service expects unencrypted connections at first with starttls support.


1

Below are my settings for sending mail through GMail: (require 'nnir) (setq gnus-select-method '(nnimap "gmail" (nnimap-address "imap.gmail.com") (nnimap-server-port 993) (nnimap-stream ssl) (nnir-search-engine imap))) (setq send-mail-function 'smtpmail-send-it message-send-mail-...


Only top voted, non community-wiki answers of a minimum length are eligible