com.sun.mail.smtp.SMTPSendFailedException: 554 DT:SPM 163 smtp11,D8CowAC3cuDofbZXKWsnCw–.47929S2 147*****77,please see http://mail.163.com/help/help_spam_16.htm?ip=183.15.215.182&hostid=smtp11&time=147*****77
这个是用smtp发送邮件给其他邮箱,本来好好的可以发送,但是突然又不行了,
554 MI:SPB 此用户不在网易允许的发信用户列表里。
可能原因:
1、发送大量的广告信/推广信。(广告邮件)
2、发送了用户事先并未提出要求或者同意接收的邮件。(垃圾邮件)
3、发送的邮件包含大量不存在的收件人。
邮箱:message[]报 Exception in thread “pool-2-thread-1” java.lang.OutOfMemoryError: Java heap space
邮箱以这种方式
// 以只读模式打开收件箱 folder.open(Folder.READ_ONLY); //根据日期过滤邮件 Calendar calendar = Calendar.getInstance(); // 两天之前 calendar.add(Calendar.DAY_OF_MONTH, -2); Date fromDate = calendar.getTime(); // ComparisonTerm类常用于日期和数字比较中,它使用六个常量EQ(=)、GE(>=)、GT(>)、LE(<=)、LT(<)、NE(!=)来表示六种不同的比较操作。 SearchTerm send = new SentDateTerm(ComparisonTerm.GE, fromDate); // 5 SearchTerm send2 = new SentDateTerm(ComparisonTerm.LE, new Date()); //ComparisonTerm.EQ相等 1 SearchTerm comparisonAndTerm = new AndTerm(send, send2); Message message[] = folder.search(comparisonAndTerm);
message message[] =folder.search(comparisonAndTerm
);
会报以下错误
Exception in thread “pool-2-thread-1” java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2271)
at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:113)
at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:122)
at com.sun.mail.pop3.Protocol.multilineCommand(Protocol.java:530)
at com.sun.mail.pop3.Protocol.retr(Protocol.java:338)
at com.sun.mail.pop3.POP3Message.getContentStream(POP3Message.java:141)
at com.sun.mail.pop3.POP3Message.loadHeaders(POP3Message.java:464)
at com.sun.mail.pop3.POP3Message.getHeader(POP3Message.java:283)
at javax.mail.internet.MimeMessage.getSentDate(MimeMessage.java:823)
at javax.mail.search.SentDateTerm.match(SentDateTerm.java:73)
at javax.mail.search.AndTerm.match(AndTerm.java:102)
at javax.mail.Message.match(Message.java:701)
at javax.mail.Folder.search(Folder.java:1266)
at javax.mail.Folder.search(Folder.java:1227)
at com.rhxy.utils.UpdateEmailService.updateMail(UpdateEmailService.java:236)
at com.rhxy.utils.UpdateEmailService.access$200(UpdateEmailService.java:35)
at com.rhxy.utils.UpdateEmailService$runUpdataEmail.run(UpdateEmailService.java:137)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
解决办法
去掉条件直接读取全部邮件,
message message[] = folder.getMessages();
不加条件即可解决去查询邮件,即可解决