Please log in with your web browser and then try again. Learn more at https://support.google.com/mail/?p=WebLoginRequired r128sm68955pfc.141 - gsmtp
https://support.google.com/mail/answer/7126229?authuser=1&authuser=1&hl=en&authuser=1&visit_id=637411909974526148-4283009967&rd=2
设置
开启SMTP
Username and Password not accepted. Learn more at https://support.google.com/mail/?p=BadCredentials e11sm328665pgs.41 - gsmtp
https://support.google.com/mail/answer/7126229?p=BadCredentials&visit_id=637411909974526148-4283009967&rd=2#cantsignin
开启2-Step验证
添加app password
配置汇总
# 邮件服务器的SMTP地址
host = smtp.gmail.com
# 邮件服务器的SMTP端口
port = 465
# 发件人(必须正确,否则发送失败)
from = x@gmail.com
# 用户名(注意:如果使用foxmail邮箱,此处user为qq号)
user = x@gmail.com
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
pass = 123456
# SMTP超时时长,单位毫秒,缺省值不超时
timeout = 5000
# Socket连接超时值,单位毫秒,缺省值不超时
connectionTimeout = 5000
# 使用SSL安全连接
sslEnable = true
# 指定实现javax.net.SocketFactory接口的类的名称,这个类将被用于创建SMTP的套接字
socketFactoryClass = javax.net.ssl.SSLSocketFactory
# 如果设置为true,未能创建一个套接字使用指定的套接字工厂类将导致使用java.net.Socket创建的套接字类, 默认值为true
socketFactoryFallback = true
# 指定的端口连接到在使用指定的套接字工厂。如果没有设置,将使用默认端口465
socketFactoryPort = 465