dcsimg
How do I determine if the SMTPMessage message was successfully sent, or failed
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   John_Yeary
Posted On:   Sunday, August 8, 2004 06:17 PM

How do I determine if an SMTPMessage was sent successfully usiing the messaging excpetions. I have set the "mail.smtp.reportsuccess" to true as follows: props = System.getProperties(); props.put("mail.smtp.host", smtphost); props.put("mail.smtp.sendpartial", Boolean.TRUE); props.put("mail.smtp.dsn.notify", "SUCCESS,FAILURE"); props.put("mail.smtp.dsn.ret", "FULL"); props.put("mail.smtp.reportsuccess", Boolean.TRUE); Later in my code I use the following to catch exceptions catch (SMTPSendSucceededException sse) { while (sse.getNextException() != null) { System.out.println(ss   More>>

How do I determine if an SMTPMessage was sent successfully usiing the messaging excpetions.


I have set the "mail.smtp.reportsuccess" to true as follows:


			
props = System.getProperties();
props.put("mail.smtp.host", smtphost);
props.put("mail.smtp.sendpartial", Boolean.TRUE);
props.put("mail.smtp.dsn.notify", "SUCCESS,FAILURE");
props.put("mail.smtp.dsn.ret", "FULL");
props.put("mail.smtp.reportsuccess", Boolean.TRUE);

Later in my code I use the following to catch exceptions


			
catch (SMTPSendSucceededException sse) {
while (sse.getNextException() != null) {
System.out.println(sse.toString());
System.out.println("SUCCEEDED");

if (verbose) {
System.out.println("Address: " + sse.getAddress());
System.out.println("Command: " + sse.getCommand());
System.out.println("Return Code: " + sse.getReturnCode());
System.out.println("Response: " + sse.getMessage());
System.out.println("Message:");
try {
msg.writeTo(System.out);
} catch (IOException ignored) {
} catch (MessagingException ignored) {}
}
}

}

I have yet to recieve a message an exception even with multiple recipients where there is an intentional error in the addressing. Any assistance in explaining the missing concepts would be appreciated. I am using the early access release 1.3.2

   <<Less
About | Sitemap | Contact