use of com.outjected.email.api.InvalidAddressException in project simple-email by codylerum.
the class MailUtility method internetAddress.
public static InternetAddress internetAddress(String address, String name) throws InvalidAddressException {
InternetAddress internetAddress;
try {
internetAddress = new InternetAddress(address);
internetAddress.setPersonal(name);
return internetAddress;
} catch (AddressException e) {
throw new InvalidAddressException(e);
} catch (UnsupportedEncodingException e) {
throw new InvalidAddressException(e);
}
}
Aggregations