diff --git a/components/email-sender/org.wso2.carbon.email.sender.core/src/main/java/org/wso2/carbon/email/sender/core/service/EmailSenderServiceImpl.java b/components/email-sender/org.wso2.carbon.email.sender.core/src/main/java/org/wso2/carbon/email/sender/core/service/EmailSenderServiceImpl.java index daaf8f61029..791b61daa9d 100644 --- a/components/email-sender/org.wso2.carbon.email.sender.core/src/main/java/org/wso2/carbon/email/sender/core/service/EmailSenderServiceImpl.java +++ b/components/email-sender/org.wso2.carbon.email.sender.core/src/main/java/org/wso2/carbon/email/sender/core/service/EmailSenderServiceImpl.java @@ -71,12 +71,14 @@ public class EmailSenderServiceImpl implements EmailSenderService { if(EmailSenderDataHolder.getInstance().getConfigurationContextService() .getServerConfigContext().getAxisConfiguration().getTransportOut(transportSenderName) == null){ log.warn("Email invitation is not sent as the email is not configured."); + } else { + threadPoolExecutor.submit(new EmailSender(recipient, emailData.getSubject(), emailData.getBody())); } } catch (ContentProcessingInterruptedException e) { throw new EmailSendingFailedException("Error occurred while retrieving email content to be " + "sent for recipient '" + recipient + "'", e); } - threadPoolExecutor.submit(new EmailSender(recipient, emailData.getSubject(), emailData.getBody())); + } }