简体   繁体   English

com.sun.mail.smtp.SMTPSendFailedException Javamail

[英]com.sun.mail.smtp.SMTPSendFailedException Javamail

I try to send an email using javaMail version 1.5.5, I got this SMTPSendFailedException and I don't know why. 我尝试使用JavaMail 1.5.5版发送电子邮件,我收到此SMTPSendFailedException,但我不知道为什么。

Here a part of the exception: 这里是例外的一部分:

com.sun.mail.smtp.SMTPSendFailedException: 555 5.5.2 Syntax error. com.sun.mail.smtp.SMTPSendFailedException:555 5.5.2语法错误。 w133sm10373661ywa.37 - gsmtp w133sm10373661ywa.37-gsmtp

at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)

My properties are: 我的属性是:

Properties props = new Properties(); 属性props = new Properties();

props.put("mail.smtp.host", "smtp.gmail.com"); props.put(“ mail.smtp.host”,“ smtp.gmail.com”);

    props.setProperty("mail.smtp.starttls.enable", "true");

    props.setProperty("mail.smtp.port", "587");

    props.setProperty("mail.smtp.user", "user";

    props.setProperty("mail.smtp.auth", "true");

    props.setProperty("mail.smtp.ssl.enable", "false");

    props.setProperty("mail.session.mail.smtp.auth.mechanisms", "LOGIN");
    props.setProperty("mail.session.mail.smtp.auth.plain.disable", "false");

    props.setProperty("mail.session.mail.smtp.starttls.enable", "false");
    props.put("mail.smtp.connectiontimeout", 6000);

It doesn't like your From address. 它不喜欢您的“发件人”地址。 When you constructed the message, did you use the setFrom method? 构造消息时,是否使用过setFrom方法? What address did you supply? 您提供了什么地址?

It might help to see the JavaMail debug output showing exactly what's being sent to the server. 可能会有助于查看JavaMail调试输出 ,以准确显示正在发送到服务器的内容。

Also, those mail.session.* properties are not valid JavaMail properties. 同样,那些mail.session.*属性也不是有效的JavaMail属性。 Did you expect JavaMail to look at them or are you using them for some other purpose? 您是否希望JavaMail能够查看它们,或者您将它们用于其他目的?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MailSendException:失败的消息:com.sun.mail.smtp.SMTPSendFailedException - MailSendException: Failed messages: com.sun.mail.smtp.SMTPSendFailedException com.sun.mail.smtp.SMTPSendFailedException:530 5.7.1客户端未通过身份验证 - com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.1 Client was not authenticated 如何解决com.sun.mail.smtp.SMTPSendFailedException在Java中? - how to solve com.sun.mail.smtp.SMTPSendFailedException in java ? com.sun.mail.smtp.SMTPSendFailedException:530-5.5.1需要身份验证(Java Mail) - com.sun.mail.smtp.SMTPSendFailedException: 530-5.5.1 Authentication Required (Java Mail) Spring Boot 邮件发件人错误:com.sun.mail.smtp.SMTPSendFailedException - Error at Spring Boot mail sender: com.sun.mail.smtp.SMTPSendFailedException com.sun.mail.smtp.SMTPSendFailedException:530 5.7.0必须首先发出STARTTLS命令 - com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first com.sun.mail.smtp.SMTPSendFailedException: 530-5.5.1 需要身份验证 - com.sun.mail.smtp.SMTPSendFailedException: 530-5.5.1 Authentication Required com.sun.mail.smtp.SMTPSendFailedException:452 4.4.5磁盘空间不足; 稍后再试 - com.sun.mail.smtp.SMTPSendFailedException: 452 4.4.5 Insufficient disk space; try again later 错误:com.sun.mail.smtp.SMTPSendFailedException:451 4.3.0 错误:队列文件写入错误 - Error: com.sun.mail.smtp.SMTPSendFailedException: 451 4.3.0 Error: queue file write error 如何解决 com.sun.mail.smtp.SMTPSendFailedException:554 Email 被拒绝 - How to resolve com.sun.mail.smtp.SMTPSendFailedException: 554 Email rejected
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM