NutzCN Logo
问答 性能测试,发送500邮件到163邮箱
发布于 2830天前 作者 qq_4a89c7c9 3291 次浏览 复制 上一个帖子 下一个帖子
标签:

参照EmailServiceImpl里的实现,往自己的一个163邮箱发送500封邮件,结果好几次都是到了大概250封左右,后台抛异常

Caused by: javax.mail.MessagingException: Can't send command to SMTP host;
  nested exception is:
	java.net.SocketException: Connection closed by remote host
	at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:2306)
	at com.sun.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:2293)
	at com.sun.mail.smtp.SMTPTransport.close(SMTPTransport.java:1333)
	at javax.mail.Transport.send0(Transport.java:257)
	at javax.mail.Transport.send(Transport.java:124)
	at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1411)
	... 8 more

是不是163邮箱的防垃圾邮件的设置啊,连续接收到邮件,认为是垃圾邮件,关闭连接了?
还是本身代码的问题


@Inject("refer:$ioc") protected Ioc ioc; public boolean send(String to, String subject, String html) { try { HtmlEmail email = ioc.get(HtmlEmail.class); email.setSubject(subject); email.setHtmlMsg(html); email.setCharset("utf-8"); email.addTo(to); email.buildMimeMessage(); email.sendMimeMessage(); return true; } catch (Throwable e) { log.error("send email fail", e); return false; } }
2 回复

要是你做服务器, 你觉得这发送频率是垃圾邮件吗?

没有必要这样测试

添加回复
请先登陆
回到顶部