How can I Keep track of the status of the mail after it has been sent....
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Smitha_Mathew
Posted On:   Wednesday, March 21, 2001 11:30 PM

How can I Keep track of the status of the mail (eg: delivered, accessed, not delivered etc) after it has been sent to a number of recipients?

Re: How can I Keep track of the status of the mail after it has been sent....

Posted By:   Florin_Rapan  
Posted On:   Friday, March 23, 2001 01:20 PM

1. For each mail operation use a try/catch to grab successful/error messages from Java Mail API:



--------


public String mail(String to, String cc, String bcc,String subject, String mailMessage)


try{



// create Java mail session, build message, set MIME type(s), set recipients

//& subject, create transport, send message



status="OK";



} catch (AddressException e) {


status = "There was an error parsing the addresses :" + e.getMessage();


} catch (SendFailedException e) {


status = "There was an error sending the message : "+e.getMessage();


} catch (MessagingException e) {


status = "There was an unexpected error : "+e.getMessage();


}


return status;


}




2. build a method which would record the returned status into an RDBMS system
database.


----------------


Hope this helps.
About | Sitemap | Contact