MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress("xyz@example.com"));
msg.addRecipient(Message.RecipientType.TO, new InternetAddress("abcd@example.com"));
Getting error in last two lines that unhandled exception type MessagingException
.
Eclipse suggests me to cover them with a try catch block.But when i tried to search in internet they are using these two statement without any try catch block. so i think i am doing something wrong. how to solve this?