on 04-02-2007 4:14 AM
does anyone have any idea how to implement this...
javamail dsn.jar delivery status notification check...
to check the invalid mail address ?
Hi,
From javamail 1.4 onwards it supports creating and parsing Delivery Status Notifications.For this,you need to include dsn.jar in your CLASSPATH along with mail.jar.To get the report, you can use SmtpMessage.setNotifyOptions. Take a look at the following code:
} else if (p.isMimeType("multipart/report")) {
pr("This is a Multipart Report");
pr("----
");
MultipartReport mr = (MultipartReport)p.getContent();
level++;
pr("Report Text");
try {
String t = mr.getText();
if (t == null)
pr("NULL");
else if (showStructure)
pr("Size: " + t.length());
else
pr(t);
} catch (MessagingException ex) {
pr(ex.toString());
}
pr("Delivery Status");
DeliveryStatus ds = mr.getDeliveryStatus();
if (ds == null)
pr("NULL");
else
pr(ds.toString());
MimeMessage rm = mr.getReturnedMessage();
if (rm != null) {
if (rm instanceof MessageHeaders) {
pr("Returned Message Headers");
pr("----
");
level++;
dumpEnvelope(rm);
level--;
} else {
pr("Returned Message");
pr("----
");
level++;
dumpPart(rm);
level--;
}
}
level--;
regards,
Shyam.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
showStructure is not defined in my program pls advice...
there is error in showStructure...
pls help...
try {
String t = mr.getText();
if (t == null)
System.err.println("NULL");
else if (showStructure)
System.err.println("Size: " + t.length());
else System.err.println(t);
} catch (MessagingException ex) {
System.err.println(ex.toString());
}
Message was edited by:
yzme yzme
Hi,
Check this:
regards
Shyam.
big headache...
i am getting...class cast exception
in this
MultipartReport mr = (MultipartReport)p.getContent();
else if(p.isMimeType("multipart/report")){
System.err.println("This is a Multipart Report");
System.err.println("---------------------------");
System.err.println("content type:" +p.getContentType());
Object o=p.getContent();
MultipartReport mr = (MultipartReport)p.getContent();
when i try to get the content type of p.getContentType();
it returns
content type:multipart/report; report-type=delivery-status; boundary="914595687200704031959122308@emg-mrk04.localdns.com"
Message was edited by:
yzme yzme
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.