@Override public void setBcc(String bcc) throws MailParseException { try { this.helper.setBcc(bcc); } catch (MessagingException ex) { throw new MailParseException(ex); } }
@Override public void setBcc(String... bcc) throws MailParseException { try { this.helper.setBcc(bcc); } catch (MessagingException ex) { throw new MailParseException(ex); } }
public void setBcc(String[] bcc) throws MessagingException { Assert.notNull(bcc, "Bcc address array must not be null"); InternetAddress[] addresses = new InternetAddress[bcc.length]; for (int i = 0; i < bcc.length; i++) { addresses[i] = parseAddress(bcc[i]); } setBcc(addresses); }
public void setBcc(String bcc) throws MessagingException { Assert.notNull(bcc, "Bcc address must not be null"); setBcc(parseAddress(bcc)); }
@Override public void setBcc(String bcc) throws MailParseException { try { this.helper.setBcc(bcc); } catch (MessagingException ex) { throw new MailParseException(ex); } }
@Override public void setBcc(String... bcc) throws MailParseException { try { this.helper.setBcc(bcc); } catch (MessagingException ex) { throw new MailParseException(ex); } }
public void setBcc(String bcc) throws MessagingException { Assert.notNull(bcc, "Bcc address must not be null"); setBcc(parseAddress(bcc)); }
public void setBcc(String[] bcc) throws MessagingException { Assert.notNull(bcc, "Bcc address array must not be null"); InternetAddress[] addresses = new InternetAddress[bcc.length]; for (int i = 0; i < bcc.length; i++) { addresses[i] = parseAddress(bcc[i]); } setBcc(addresses); }
@Override public void prepare(MimeMessage mimeMessage) throws Exception { EmailTarget emailUser = (EmailTarget) props.get(EmailPropertyType.USER.getType()); EmailInfo info = (EmailInfo) props.get(EmailPropertyType.INFO.getType()); boolean isMultipart = CollectionUtils.isNotEmpty(info.getAttachments()); MimeMessageHelper message = new MimeMessageHelper(mimeMessage, isMultipart, info.getEncoding()); message.setTo(emailUser.getEmailAddress()); message.setFrom(info.getFromAddress()); message.setSubject(info.getSubject()); if (emailUser.getBCCAddresses() != null && emailUser.getBCCAddresses().length > 0) { message.setBcc(emailUser.getBCCAddresses()); } if (emailUser.getCCAddresses() != null && emailUser.getCCAddresses().length > 0) { message.setCc(emailUser.getCCAddresses()); } String messageBody = info.getMessageBody(); if (messageBody == null) { messageBody = buildMessageBody(info, props); } message.setText(messageBody, true); for (Attachment attachment : info.getAttachments()) { ByteArrayDataSource dataSource = new ByteArrayDataSource(attachment.getData(), attachment.getMimeType()); message.addAttachment(attachment.getFilename(), dataSource); } } };
@Override public void setBcc(String bcc) throws MailParseException { try { this.helper.setBcc(bcc); } catch (MessagingException ex) { throw new MailParseException(ex); } }
@Override public void setBcc(String[] bcc) throws MailParseException { try { this.helper.setBcc(bcc); } catch (MessagingException ex) { throw new MailParseException(ex); } }
public void setBcc(String[] bcc) throws MessagingException { Assert.notNull(bcc, "Bcc address array must not be null"); InternetAddress[] addresses = new InternetAddress[bcc.length]; for (int i = 0; i < bcc.length; i++) { addresses[i] = parseAddress(bcc[i]); } setBcc(addresses); }
public void setBcc(String bcc) throws MessagingException { Assert.notNull(bcc, "Bcc address must not be null"); setBcc(parseAddress(bcc)); }
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void prepare(MimeMessage mimeMessage) throws Exception { MimeMessageHelper message = new MimeMessageHelper(mimeMessage, true, "UTF-8"); message.setTo("adrianmatei@gmail.com"); message.setBcc("adrian.matei@yahoo.com"); message.setFrom("contact@podcastpedia.org"); message.setSubject("Latest episodes from your podcast subscriptions");//or maybe name some + "and more", like you tube message.setSentDate(new Date()); Map model = new HashMap(); model.put("user", emailSubscriber); //set today's date Date now = new Date(); SimpleDateFormat dateFormat = new SimpleDateFormat("MMM dd, yyyy", Locale.US); model.put("today", dateFormat.format(now)); String text = VelocityEngineUtils.mergeTemplateIntoString( velocityEngine, "templates/new_episodes_table.vm", "UTF-8", model); message.setText(text, true); System.out.println(text); } };
@SuppressWarnings({ "rawtypes", "unchecked" }) public void prepare(MimeMessage mimeMessage) throws Exception { MimeMessageHelper message = new MimeMessageHelper(mimeMessage); message.setTo(user.getUsername()); message.setBcc("adrianmatei@gmail.com"); message.setSubject("Podcastpedia.org - reset password"); message.setSentDate(new Date()); message.setFrom("no-reply@podcastpedia.org"); Map model = new HashMap(); model.put("localAddr", localAddr); model.put("user", user); String text = buildEmailText(model, velocityEngine, "passwordResetEmailConfirmation"); message.setText(text, true); } };
@SuppressWarnings({ "rawtypes", "unchecked" }) public void prepare(MimeMessage mimeMessage) throws Exception { MimeMessageHelper message = new MimeMessageHelper(mimeMessage); message.setTo(user.getUsername()); message.setBcc("adrianmatei@gmail.com"); message.setSubject("Podcastpedia.org - confirm registration"); message.setSentDate(new Date()); message.setFrom(configService.getValue("email.from.user.registration.form")); Map model = new HashMap(); model.put("user", user); String text = buildEmailText(model, velocityEngine, "newUserRegistrationEmailConfirmation"); message.setText(text, true); } };
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void prepare(MimeMessage mimeMessage) throws Exception { MimeMessageHelper message = new MimeMessageHelper(mimeMessage, true, "UTF-8"); message.setTo("adrianmatei@gmail.com"); message.setBcc("adrian.matei@yahoo.com"); message.setFrom("contact@podcastpedia.org"); message.setSubject("Your podcast has been added to Podcastpedia.org"); message.setSentDate(new Date()); Map model = new HashMap(); model.put("name", name); model.put("podcastUrl", podcastUrl); String text = VelocityEngineUtils.mergeTemplateIntoString( velocityEngine, "templates/podcast_addition_notification.vm", "UTF-8", model); message.setText(text, true); //IMPORTANT - see documentation for setText // message.addInline("fb_logo", new ClassPathResource("img/fb_51.png")); // message.addInline("twitter_logo", new ClassPathResource("img/twitter_51.png")); // message.addInline("gplus_logo", new ClassPathResource("img/gplus_51.png")); } };
@SuppressWarnings({ "rawtypes", "unchecked" }) public void prepare(MimeMessage mimeMessage) throws Exception { MimeMessageHelper message = new MimeMessageHelper(mimeMessage); message.setTo(configService.getValue("EMAIL_TO_CONTACT_MESSAGE")); message.setBcc("adrianmatei@gmail.com"); message.setSubject("New user registration request"); message.setFrom(configService.getValue("email.from.user.registration.form")); //EMAIL_FROM_CONTACT_MESSAGE")"no-reply@podcastpedia.org"); message.setSentDate(new Date()); Map model = new HashMap(); model.put("user", user); String text = buildEmailText(model, velocityEngine, "newUserRegistrationEmailConfirmation"); message.setText(text, true); } };
@Override public MimeMessage filter(MimeMessageHelper mimeMessageHelper) throws MessagingException { Map<Message.RecipientType, String[]> recipientsFiltered = this.getFilteredRecipients(mimeMessageHelper.getMimeMessage()); String[] recipientsTo = recipientsFiltered.get(Message.RecipientType.TO); String[] recipientsCc = recipientsFiltered.get(Message.RecipientType.CC); String[] recipientsBcc = recipientsFiltered.get(Message.RecipientType.BCC); if (isRecipientsArrayNotEmpty(recipientsTo) || isRecipientsArrayNotEmpty(recipientsCc) || isRecipientsArrayNotEmpty(recipientsBcc) ) { mimeMessageHelper.setFrom(from); mimeMessageHelper.setTo(isRecipientsArrayNotEmpty(recipientsTo) ? recipientsTo : new String[0]); mimeMessageHelper.setCc(isRecipientsArrayNotEmpty(recipientsCc) ? recipientsCc : new String[0]); mimeMessageHelper.setBcc(isRecipientsArrayNotEmpty(recipientsBcc) ? recipientsBcc : new String[0]); return mimeMessageHelper.getMimeMessage(); } else { LOGGER.info( "A mail with recipient(s) '{}' and subject '{}' was not sent because the recipient adresses were filtered by mailfilters {}", Arrays.toString(mimeMessageHelper.getMimeMessage().getRecipients(Message.RecipientType.TO)), mimeMessageHelper.getMimeMessage().getSubject(), this.filters); throw new MessagingException("Trying to send a mail without recipient!"); } }
public void prepare(MimeMessage mimeMessage) throws MessagingException { MimeMessageHelper messageHelper = new MimeMessageHelper(mimeMessage, true, Charsets.UTF_8.toString()); try { messageHelper.setFrom(message.getFrom(), message.getFromName()); } catch (UnsupportedEncodingException e) { throw new MessagingException( "UnsupportedEncodingException while encode 'the name of FROM person'", e); } messageHelper.setTo(message.getTo()); if (message.getBcc() != null) { messageHelper.setBcc(message.getBcc()); } if (message.getCc() != null) { messageHelper.setCc(message.getCc()); } if (message.getReplyTo() != null) { messageHelper.setReplyTo(message.getReplyTo()); } messageHelper.setSubject(message.getSubject()); messageHelper.setText(message.getText()); }