Commit e04cfd30 authored by michael.simon's avatar michael.simon
Browse files

Add error message if "from" or "to" is empty in template. All other

values should be possible as null values.
parent b7191f4d
......@@ -55,9 +55,12 @@ public class MailServiceImpl implements MailService {
}
private void sendMailIntern(String from, String to, String cc, String bcc, String subject, String body)
throws AddressException, MessagingException {
throws AddressException, MessagingException, MailServiceException {
Message message = new MimeMessage(session);
if (from == null || to == null)
throw new MailServiceException("From or To may not be null. Please set From an To in Email Template");
message.setFrom(new InternetAddress(from));
message.setRecipients(Message.RecipientType.TO,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment