on 04-04-2007 4:45 AM
if there are several receipients........
i have read that i can use the transport options to check the acknowledgement if send to the receipient successfully....
without using dsn.jar
pls advice
MESSAGE_DELIVERED
When the message has been successfully sent to all recipients by this transport. validSent[] contains all the addresses. validUnsent[] and invalid[] are null.
MESSAGE_NOT_DELIVERED
When ValidSent[] is null, the message was not successfully sent to any recipients. validUnsent[] may have addresses that are valid. invalidSent[] may contain invalid addresses.
MESSAGE_PARTIALLY_DELIVERED
Message was successfully sent to some recipients but not to all. ValidSent[] holds addresses of recipients to whom the message was sent. validUnsent[] holds valid addresses but the message wasn't sent to them. invalid[] holds invalid addresses.
// Get a session
Session session = Session.getInstance(props, null);
// Create an empty MimeMessage and its part
Message msg = new MimeMessage(session);
... add headers and message parts as before
// create two destination addresses
Address[] addrs = {new InternetAddress("mickey@disney.com"),
new InternetAddress("goofy@disney.com")};
// get a transport that can handle sending message to
// InternetAddresses. This will probably map to a transport
// that supports SMTP.
Transport trans = session.getTransport(addrs[0]);
// add ourselves as ConnectionEvent and TransportEvent listeners
trans.addConnectionListener(this);
trans.addTransportListener(this);
// connect method determines what host to use from the
// session properties
trans.connect();
// send the message to the addresses we specified above
trans.sendMessage(msg, addrs);
Hi,
go thru this:
<a href="http://www.koders.com/java/fid32C7D5CB68251AD6AB16F4099820E58793770886.aspx#L78">Link</a>
regards
Shyam.
null
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.