public synchronized void run() { try { final List<String> additionalHeaders = new ArrayList<String>(); additionalHeaders.add("Content-Type: text/plain; charset=ISO-8859-1"); final String emailFromAddress = "\"" + service + "\" <no-reply@" + serverName + ">"; emailService.send(emailFromAddress, email, subject, message, email, null, additionalHeaders); } catch (Exception e) { logger.error("sendEmail() failed for email: " + email,e); } } }
@Autowired public EmailService emailService; public void sendEmail(){ final Email email = EmailImpl.builder() .from(new InternetAddress("mymail@mail.co.uk")) .replyTo(new InternetAddress("someone@localhost")) .to(Lists.newArrayList(new InternetAddress("someone@localhost"))) .subject("Lorem ipsum") .body("Lorem ipsum dolor sit amet [...]") .encoding(Charset.forName("UTF-8")).build(); emailService.send(email); }
public static void send(java.lang.String param0, java.lang.String param1, java.lang.String param2, java.lang.String param3, java.lang.String param4, java.lang.String param5, java.util.List param6) { org.sakaiproject.email.api.EmailService service = getInstance(); if (service == null) return; service.send(param0, param1, param2, param3, param4, param5, param6); }
public static void send(java.lang.String param0, java.lang.String param1, java.lang.String param2, java.lang.String param3, java.lang.String param4, java.lang.String param5, java.util.List param6) { org.sakaiproject.email.api.EmailService service = getInstance(); if (service == null) return; service.send(param0, param1, param2, param3, param4, param5, param6); }
private void sendEmail(DataProcessor dp, ProcessorState state) { if (emailNotification && recipients != null) { for (String recipient : recipients) { emailService.send(fromAddress, recipient, dp.getProcessorTitle(), dp.getReport(state), null, null, null); } } } }
private void sentNotification(BackfillItemHashResult itemBackfillResult, BackfillItemHashResult publishedItemBackfillResult, RuntimeException error) { final String to = getNotificationEmailAddress(); if ( to == null ) { return; } final String from = "<"+ serverConfigurationService.getString("setup.request","no-reply@" + serverConfigurationService.getServerName()) + ">"; final StringBuilder body = new StringBuilder(); if ( error != null ) { body.append("Job failed with following error message. See logs for full details.").append("\n\n") .append(error.getMessage()) .append("\n\n"); } body.append(jobResultMessage(itemBackfillResult, publishedItemBackfillResult, "\n\n")); emailService.send(from, to, "Backfill Item Hash Job: " + (error == null ? "Success" : "Failure"), body.toString(), to, null, null); }
private void sendEmail(DataProcessor dp, ProcessorState state) { if (emailNotification && recipients != null) { for (String recipient : recipients) { emailService.send(fromAddress, recipient, dp.getProcessorTitle(), dp.getReport(state), null, null, null); } } } }
private void sentNotification(BackfillItemHashResult itemBackfillResult, BackfillItemHashResult publishedItemBackfillResult, RuntimeException error) { final String to = getNotificationEmailAddress(); if ( to == null ) { return; } final String from = "<"+ serverConfigurationService.getString("setup.request","no-reply@" + serverConfigurationService.getServerName()) + ">"; final StringBuilder body = new StringBuilder(); if ( error != null ) { body.append("Job failed with following error message. See logs for full details.").append("\n\n") .append(error.getMessage()) .append("\n\n"); } body.append(jobResultMessage(itemBackfillResult, publishedItemBackfillResult, "\n\n")); emailService.send(from, to, "Backfill Item Hash Job: " + (error == null ? "Success" : "Failure"), body.toString(), to, null, null); }
private void sendEmail(User user, SignupEmailNotification email) { logger.debug("sendMail called for user:" + user.getEid()); try { EmailMessage message = convertSignupEmail(email, user); if(message != null) { emailService.send(message); } } catch (NoRecipientsException e) { logger.error("Cannot send mail. No recipient." + e.getMessage()); } catch (AddressValidationException e) { //this should be caught when adding the email address, since it is validated then. logger.warn("Cannot send mail to user: " + user.getEid() + ". Invalid email address." + EmailAddress.toString(e.getInvalidEmailAddresses())); } }
emailService.send(from, newUserEmail, message_subject, content, newUserEmail, newUserEmail, headers);
emailService.send(from, to, subject, body.toString(), to, null, null);
emailService.send(mailSubject, mailTo, mailText);
emailService.send(from, newUserEmail, message_subject, content, newUserEmail, newUserEmail, headers);
String from = "\" <"+ serverConfigurationService.getString("setup.request","no-reply@" + serverConfigurationService.getServerName()) + ">"; if (emailService != null) { emailService.send(from, emailAddr, subject, body + "\n" + stacktrace, emailAddr, null, null); } else { log.error("Could not send email, no emailService");
subject = template.getRenderedSubject(); emailService.send(from, user.getEmail(), subject, content, user.getEmail(), from, null); } catch (UserNotDefinedException e) {