使用JavaMail,我正在创建一个可以处理退回电子邮件的程序。我指的是这个教程http://www.tutorialspoint.com/javamail_api/javamail_api_bounced_messages.htm。
如果电子邮件被退回,有没有办法捕获?
boolean bounce = false; //how can i make this TRUE if the email is bounced?
try {
System.out.println("Sending ....");
transport.connect(smtpServer, port, userid, password);
transport.sendMessage(message,
message.getRecipients(Message.RecipientType.TO));
System.out.println("Sending done ...");
} catch (Exception e) {
System.err.println("Error Sending: ");
e.printStackTrace();
}
提前致谢!