SendFailedException sfex = (SendFailedException) ex; Address[] invalid = sfex.getInvalidAddresses(); if ( invalid != null ) { logError( " ** Invalid Addresses" );
Address[] a = sex.getInvalidAddresses(); if (a != null) for (int j = 0; j < a.length; j++)
Address[] a = sex.getInvalidAddresses(); if (a != null) for (int j = 0; j < a.length; j++)
Address[] recip = sfe.getInvalidAddresses(); if (recip != null && recip.length != 0) { setErrorContent(abort, verify, sfe);
Address[] recip = sfe.getInvalidAddresses(); if (recip != null && recip.length != 0) { setErrorContent(abort, verify, sfe);
if (exception.getInvalidAddresses().length == 0 && exception.getValidUnsentAddresses().length == 0) { return null; sb.append(" ( "); if (exception.getInvalidAddresses().length > 0) { sb.append(Arrays.toString(exception.getInvalidAddresses())); invalidAddr = true;
@Override public void send(String fromAddress, String[] toAddresses, String subject, String body) { String joinedToAddresses = Joiner.on(",").join(toAddresses); LOGGER.info("sending SMTP email from: \"%s\", to: \"%s\", subject: \"%s\"", fromAddress, joinedToAddresses, subject); LOGGER.debug("sending SMTP email body:%n%s", body); try { MimeMessage mimeMessage = new MimeMessage(getSession()); mimeMessage.setFrom(InternetAddress.parse(fromAddress)[0]); mimeMessage.setSubject(subject, CHARSET); if (body.startsWith("<html>")) { Multipart multipart = new MimeMultipart(); MimeBodyPart html = new MimeBodyPart(); String contentType = "text/html; charset=" + CHARSET; html.setHeader("Content-Type", contentType); html.setContent(body, contentType); multipart.addBodyPart(html); mimeMessage.setContent(multipart); } else { mimeMessage.setText(body, CHARSET); } mimeMessage.setSentDate(new Date()); mimeMessage.setRecipients(Message.RecipientType.TO, InternetAddress.parse(joinedToAddresses)); Transport.send(mimeMessage); } catch (SendFailedException me) { throw new VisalloException("Error sending emails to: " + Joiner.on(",").join(me.getValidUnsentAddresses(), me.getInvalidAddresses()), me); } catch (MessagingException me) { throw new VisalloException("exception while sending email", me); } }
private void sendEmail(Message message) throws MessagingException { try { Transport.send(message); } catch (NoSuchProviderException se) { LOG.error("Could not find an SMTP transport provider to email", se); throw se; } catch (MessagingException me) { LOG.error("Message Exception in transporting SLA alert email", me); if (me instanceof SendFailedException) { Address[] invalidAddrs = ((SendFailedException) me).getInvalidAddresses(); if (invalidAddrs != null && invalidAddrs.length > 0) { for (Address addr : invalidAddrs) { try { // 'get' method loads key into cache when it doesn't exist AtomicInteger val = blackList.get(addr.toString()); val.incrementAndGet(); } catch (Exception e) { LOG.debug("blacklist loading threw exception: " + e.getMessage()); } } } } throw me; } }
private void sendEmail(Message message) throws MessagingException { try { Transport.send(message); } catch (NoSuchProviderException se) { LOG.error("Could not find an SMTP transport provider to email", se); throw se; } catch (MessagingException me) { LOG.error("Message Exception in transporting SLA alert email", me); if (me instanceof SendFailedException) { Address[] invalidAddrs = ((SendFailedException) me).getInvalidAddresses(); if (invalidAddrs != null && invalidAddrs.length > 0) { for (Address addr : invalidAddrs) { try { // 'get' method loads key into cache when it doesn't exist AtomicInteger val = blackList.get(addr.toString()); val.incrementAndGet(); } catch (Exception e) { LOG.debug("blacklist loading threw exception: " + e.getMessage()); } } } } throw me; } }
exAddrs = e.getInvalidAddresses(); if (exAddrs != null) { for (int j = 0; j < exAddrs.length; j++) {
exAddrs = e.getInvalidAddresses(); if (exAddrs != null) { for (int j = 0; j < exAddrs.length; j++) {
Address[] a = sex.getInvalidAddresses(); if (a != null) for (int j = 0; j < a.length; j++)
Address[] a = sex.getInvalidAddresses(); if (a != null) for (int j = 0; j < a.length; j++)
Address[] a = sex.getInvalidAddresses(); if (a != null) for (int j = 0; j < a.length; j++)
Address[] a = sex.getInvalidAddresses(); if (a != null) for (int j = 0; j < a.length; j++)
INVALID_ADDRESSES)) { Address[] invalidAddresses = sendFailedException .getInvalidAddresses(); List<String> invalidAddressList = new ArrayList<String>(); for (Address invalidAddress : invalidAddresses) {
addresses = e.getInvalidAddresses(); if (addresses != null && addresses.length > 0) { buf = new StringBuilder("Error sending to the following INVALID addresses:");
INVALID_ADDRESSES)) { Address[] invalidAddresses = sendFailedException .getInvalidAddresses(); List<String> invalidAddressList = new ArrayList<String>(); for (Address invalidAddress : invalidAddresses) {
_stats.incrementErrorCount(); NSArray<String> invalidEmails = ERMailUtils.convertInternetAddressesToNSArray(e.getInvalidAddresses()); notifyInvalidEmails(invalidEmails); message._invalidRecipients(invalidEmails);
logSendFailedException(sfe); EnhancedMessagingException enhancedMessagingException = new EnhancedMessagingException(sfe); List<MailAddress> invalidAddresses = AddressesArrayToMailAddressListConverter.getAddressesAsMailAddress(sfe.getInvalidAddresses()); List<MailAddress> validUnsentAddresses = AddressesArrayToMailAddressListConverter.getAddressesAsMailAddress(sfe.getValidUnsentAddresses()); if (configuration.isDebug()) {