cancel
Showing results for 
Search instead for 
Did you mean: 

get mail acknowledgement

Former Member
0 Kudos

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);

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

go thru this:

<a href="http://www.koders.com/java/fid32C7D5CB68251AD6AB16F4099820E58793770886.aspx#L78">Link</a>

regards

Shyam.

null