root @ sourav-HP-Pavilion-dv6500-Notebook-PC:/ var / log#echo -e“主题: 测试邮件\ r \ n \ r \ n这是我的第一封测试电子邮件。” | msmtp --debug --from = default -t souravsachdeva13@gmail.com
已加载系统配置文件/ etc / msmtprc
忽略用户配置文件/root/.msmtprc:没有此类文件或 目录
回到默认帐户
使用/ etc / msmtprc中的默认帐户
host = smtp.gmail.com
端口= 587
代理主机=(未设置)
代理端口= 0
超时=关闭
协议= smtp
domain =本地主机
auth =选择
user = souravsachdeva13@gmail.com
密码= *
passwordeval =(未设置)
ntlmdomain =(未设置)
tls =开启
tls_starttls =开启
tls_trust_file = /etc/ssl/certs/ca-certificates.crt
tls_crl_file =(未设置)
tls_fingerprint =(未设置)
tls_key_file =(未设置)
tls_cert_file =(未设置)
tls_certcheck =开启
tls_min_dh_prime_bits =(未设置)
tls_priorities =(未设置)
auto_from =关闭
maildomain =(未设置)
from =默认
add_missing_from_header =开启
add_missing_date_header =启用
remove_bcc_headers =开启
dsn_notify =(未设置)
dsn_return =(未设置)
logfile = /var/log/msmtp.log
syslog =(未设置)
别名=(未设置)
从命令行和邮件中读取收件人
msmtp:无法连接到smtp.gmail.com,端口587:连接超时
msmtp:无法发送邮件(默认帐户为/ etc / msmtprc)
root @ sourav-HP-Pavilion-dv6500-Notebook-PC:/ var / log#
我在过去的3-4个小时内尝试使用不同的服务器,但它们似乎都不适合我,这确实显示了一些输出,我认为这对调试它很有帮助。您是否看到任何设置丢失或配置错误。
答案 0 :(得分:0)
您不必获取应用程序密码吗?
我在msmtprc中写了gmail'password'。我在下面收到错误消息。
msmtp: authentication failed (method PLAIN)
msmtp: server message: 535-5.7.8 Username and Password not accepted. Learn more at
msmtp: server message: 535 5.7.8 https://support.google.com/mail/?p=BadCredentials k123-v6sm24743490pga.21 - gsmtp
msmtp: could not send mail (account gmail from /home/miwa/.msmtprc)
我设置了应用程序密码(访问错误消息中的URI),然后可以将邮件发送到Gmail。
我使用msmtp版本。 (在ArchLinux上)
% msmtp --version
msmtp version 1.6.8
Platform: x86_64-pc-linux-gnu
TLS/SSL library: GnuTLS
Authentication library: GNU SASL
Supported authentication methods:
plain scram-sha-1 external gssapi cram-md5 digest-md5 login
IDN support: enabled
NLS: enabled, LOCALEDIR is /usr/share/locale
Keyring support: Gnome
System configuration file name: /etc/msmtprc
User configuration file name: /home/miwa/.msmtprc
Copyright (C) 2018 Martin Lambers and others.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.