use of com.haulmont.cuba.core.global.EmailAttachment in project cuba by cuba-platform.
the class Emailer method sendTestEmail.
@Authenticated
@Override
public String sendTestEmail(String addresses) {
try {
String att = "<html><body><h1>Test attachment</h1></body></html>";
EmailAttachment emailAtt = EmailAttachment.createTextAttachment(att, StandardCharsets.UTF_8.name(), "test attachment.html");
emailer.sendEmail(addresses, "Test email", "<html><body><h1>Test email</h1></body></html>", emailAtt);
return "Email to '" + addresses + "' sent successfully";
} catch (Exception e) {
return ExceptionUtils.getStackTrace(e);
}
}
Aggregations