解决邮箱关闭导致的邮件无法发送问题 550 5.1.1 recipient is not exist javax.mail - 小不的笔记
常见邮箱客户端发送失败的错误代码解析 - 使用经验 - 我爱帮助网 (52help.net)
邮箱报错421及解决_青碧凝霜的博客-CSDN博客_421错误
Java 邮件发送失败常见异常类型_炎升的博客-CSDN博客_java发送邮件失败
https://doc.xuehai.net/b88093acf3cd5fe8b2e511ff1.html
[乐意黎原创] 完美解决 javax.mail.SendFailedException: Invalid Address 与 SMTPAddressFailedException 抛错_打杂人-CSDN博客
https://www.csdn.net/tags/MtTaQg3sNTQ1MTItYmxvZwO0O0OO0O0O.html
为什么Transport.sendMessage在其中一个地址无效时失败? - VoidCC
存在失效地址导致JavaMailSender批量发送失败的原因分析及解决办法_Aero_duan的专栏-CSDN博客
关于javaSMTP协议发邮件你必须知道的知识点 - 夜旦 - 博客园
查看新闻/公告--[疑问]JavaMail的mail.smtp.sendpartial不起作用?
Java mail使用QQ邮箱发送邮件配置方案及异常处理 - 灰信网(软件开发博客聚合)
(附详细编码)https://www.csdn.net/tags/MtTaQg3sNTQ1MTItYmxvZwO0O0OO0O0O.html
常见邮箱客户端发送失败的错误代码解析 - 使用经验 - 我爱帮助网
Mail Sender Demo Using JavaMail - CodeProject
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String host="smtp.gmail.com";
final String user = "";
final String password = "";
if(!user.equals("") && !password.equals(""))
{
String SMTP_PORT = "465";
String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
String to="";
//Get the session object
Properties props = new Properties();
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.host",host);
props.put("mail.smtp.auth", "true");
props.put("mail.debug", "true");
props.put("mail.smtp.port", SMTP_PORT);
// props.put("mail.smtp.socketFactory.port", SMTP_PORT);
// props.put("mail.smtp.socketFactory.class", SSL_FACTORY);
// props.put("mail.smtp.socketFactory.fallback", "false");
Session session = Session.getDefaultInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(user,password);
}
});
//Compose the message
try
{
MimeMessage message = new MimeMessage(session);
// creates message part
MimeBodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setContent(message, "text/html");
message.setFrom(new InternetAddress(user));
message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));
message.setSubject("");
message.setText("");
//send the message
Transport.send(message);
}
catch (MessagingException e) {e.printStackTrace();}
}
}