I am using apache commons email to send mails from java. I want to send undelivered mail notification to another address not to the sender. So I used
Here is my CODE..
try{
Email email = new SimpleEmail();
email.setHostName("smtp.googlemail.com");
email.setSmtpPort(465);
email.setAuthentication("MAIL", "PASSWORD");
email.setSSLOnConnect(true);
email.setFrom("MAIL");
email.setSubject("Demo");
email.setMsg("receieved");
email.addTo("MAIL");
email.setBounceAddress("[email protected]");
email.send();
System.out.println("email sent");
}
MACHLA KAWURU HARI DANNWNM UDAWWK DEEPLAKO???


email.setBounceAddress("mail");
but it is not working. Still the notification goes to the sender's address...How to get this done?
Here is my CODE..
try{
Email email = new SimpleEmail();
email.setHostName("smtp.googlemail.com");
email.setSmtpPort(465);
email.setAuthentication("MAIL", "PASSWORD");
email.setSSLOnConnect(true);
email.setFrom("MAIL");
email.setSubject("Demo");
email.setMsg("receieved");
email.addTo("MAIL");
email.setBounceAddress("[email protected]");
email.send();
System.out.println("email sent");
}
MACHLA KAWURU HARI DANNWNM UDAWWK DEEPLAKO???


