smtpmail 503 Error: need EHLO and AUTH first

Hi, everyone. I’m trying mu4e on my Emacs (ubuntu), but has been stucked on sending mail by ‘smtpmail-send-it for a week. I have configured the ~/.authinfo.gpg already, but it always shows the error :

Sending failed: 503 Error: need EHLO and AUTH first !

I have read sth about smtp , I think I lack some configuration about changing HELO to EHLO, but not sure what it is.

I have checked the official manual about Emacs sending mail part, mu4e’s documentation and some others’ configuration , all of them don’t meet this problem. Can anyone help me out? Thanks! :grinning:

Below is the snippet about my sending mail configuration.

(require 'smtpmail)
(setq send-mail-function 'smtpmail-send-it)
(setq smtpmail-smtp-server "smtp.example.com")
(setq smtpmail-smtp-service 587)
(setq smtpmail-debug-info t)
(setq smtpmail-debug-verbose t)

Are you sure? Did you read Authentication?

thanks for your reply, but I’m sure i have read it . As I’ve mentioned , I configured the ~/.authinfo.gpg (and also tried ~/.authinfo). Unfortunately it still encounters the problem . :expressionless:

并且我很确定,因为在尝试发送邮件时,Emacs提示我要输入gpg密码,输入完后,才报的错。这说明Emacs已经检查过了autoinfo. 而且我已经成功地配置好用msmtp在emacs中发送邮件,这说明我的邮件设置也没有问题。 唯独就是用内置的smtpmail-send-it 报错.

正好最近我也在整 mu4e ,我的已经整好了,收发邮件都可以,我这里的发邮件部分的配置给你参考一下

.authinfo file

machine smtp.gmail.com login [email protected] port 587 password *****

smtpmail config

(setq smtpmail-stream-type         'starttls)
(setq message-send-mail-function   'smtpmail-send-it)
(setq smtpmail-smtp-user           "[email protected]")
(setq smtpmail-local-domain        "gmail.com")
(setq smtpmail-default-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-server         "smtp.gmail.com")
(setq smtpmail-smtp-service         587)

实在是太感谢您了!我把autoinfo里的端口和emacs里的端口搞混了,设置的不一样才出现这样的情况。感谢您! :grinning: