以下是一段代码
public void sendEmail(String toEmailAddr, String subject, String body) throws AppException {
Session session = Session.getDefaultInstance(props, null);
MimeMessage message = new MimeMessage(session);
try {
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(toEmailAddr));
message.setSubject(subject);
message.setText(body);
Transport.send(message);
} catch (MessagingException ex) {
throw new AppException(
"Exception Occurred while processing EmailNotification.sendEmail method: ", ex);
}
}
在“Transport.send(message);”行中 我收到了维拉代码问题。如何解决问题。