Sends the email asynchronously. It uses the configuration provided
default callback if available, ignoring the outcome otherwise.

If you want to use a specific callback for this call use
{@link #sendAsync(MailRequestCallback)} instead.
178760
public void sendAsync() {
        if (!configuration.mailSendFilter().filter(this)) return;
        MailRequestCallbackFactory factory = configuration.mailRequestCallbackFactory();
        if (factory == null) {
            prepareSend();
            request().async().post(entity());
        } else
            sendAsync(factory.create(this));
    }
1036139
def do_async_send(self):
        
        assert len(self.sendbuf)

        nwritten = self.sock.send(self.sendbuf)
        nframes = 0

        for entry in self.sendbuf_frames:
            frame, offset, callback = entry

            if offset <= nwritten:
                nframes += 1

                if callback:
                    callback()
            else:
                entry[1] -= nwritten

        self.sendbuf = self.sendbuf[nwritten:]
        self.sendbuf_frames = self.sendbuf_frames[nframes:]
432386
public void send(String channel, String message) {
		// CAUSE: Assignment to method parameter
		Pair<Boolean, String> sendValidation = isSendValid(channel, message, null, null);

		//String lMessage = message.replace("\n", "\\n");

		if (sendValidation != null && sendValidation.first) {
			try {
				String messageId = Strings.randomString(8);
				ArrayList<Pair<String, String>> messagesToSend = multiPartMessage(
						message, messageId);
				for (Pair<String, String> messageToSend : messagesToSend) {
					send(channel, messageToSend.second, messageToSend.first,
							sendValidation.second);
				}
			} catch (IOException e) {
				raiseOrtcEvent(EventEnum.OnException, this, e);
			}
		}
	}
282640
public void sendMessage(String requestMessage, String queueName, String correlationId,
            final Queue replyQueue, int delaySeconds, int deliveryMode) throws JMSException {
        /**
         * If it's an internal message then always use jmsTemplate for ActiveMQ
         */

        if (jmsTemplate != null) {
            jmsTemplate.setDeliveryMode(deliveryMode);
            if (!StringUtils.isEmpty(queueName)) {
                jmsTemplate.send(queueName, new MDWMessageCreator(requestMessage, correlationId,
                        replyQueue, delaySeconds));

            }
            else {
                jmsTemplate.send(new MDWMessageCreator(requestMessage, correlationId, replyQueue));
            }
        }
    }
4385
public <T extends IEntity> void sendEmailAsync(T entity, CallbackHandler callbackHandler) throws FMSException {
        sendEmailAsync(entity,null,callbackHandler);
    }
135482
@Override
    public AsyncContext startAsync(ServletRequest arg0, ServletResponse arg1) {
        try {
            collaborator.preInvoke(componentMetaData);
            return request.startAsync(arg0, arg1);
        } finally {
            collaborator.postInvoke();
        }
    }
873525
public <T extends IEntity> void voidRequestAsync(T entity, CallbackHandler callbackHandler) throws FMSException {

        IntuitMessage intuitMessage = prepareVoidRequest(entity);

        //set callback handler
        intuitMessage.getRequestElements().setCallbackHandler(callbackHandler);

        //execute async interceptors
        executeAsyncInterceptors(intuitMessage);
    }
716441
protected void sendEmail(TaskRuntimeContext context, String outcome)
    throws ObserverException {
        TaskInstance taskInstance = context.getTaskInstance();
        TemplatedEmail templatedEmail = new TemplatedEmail();
        templatedEmail.setFromAddress(getFromAddress());
        templatedEmail.setSubject(getSubject(taskInstance, outcome));
        templatedEmail.setHtml(true);
        templatedEmail.setTemplateAssetVerSpec(getTemplateSpec());
        templatedEmail.setRuntimeContext(context);

        try {
            List<Address> recipients = getRecipientAddresses(outcome);
            List<Address> ccRecipients = getCcRecipientAddresses(outcome);

            if (templatedEmail.getTemplateBody().contains("${taskActionUrl}")) {

                // send individual e-mails
                for (Address recip : recipients) {
                    String cuid = recip.toString().substring(0, recip.toString().indexOf('@'));
                    String userIdentifier = MiniCrypter.encrypt(cuid);
                    taskInstance.setUserIdentifier(userIdentifier);
                    templatedEmail.setRecipients(new Address[]{recip});
                    templatedEmail.setCcRecipients(new Address[0]);
                    try {
                        templatedEmail.sendEmail();
                    }
                    catch (MessagingException ex) {
                        logger.severeException(ex.getMessage(), ex);  // do not rethrow
                    }
                }
                if (ccRecipients != null) {
                    for (Address ccRecip : ccRecipients) {
                        String cuid = ccRecip.toString().substring(0, ccRecip.toString().indexOf('@'));
                        String userIdentifier = MiniCrypter.encrypt(cuid);
                        taskInstance.setUserIdentifier(userIdentifier);
                        templatedEmail.setRecipients(new Address[0]);
                        templatedEmail.setCcRecipients(new Address[]{ccRecip});
                        try {
                            templatedEmail.sendEmail();
                        }
                        catch (MessagingException ex) {
                            logger.severeException(ex.getMessage(), ex);  // do not rethrow
                        }
                    }
                }
            }
            else {
                if ((recipients != null && !recipients.isEmpty()) || (ccRecipients != null && !ccRecipients.isEmpty())) {
                    if (recipients != null)
                        templatedEmail.setRecipients(recipients.toArray(new Address[0]));
                    if (ccRecipients != null)
                        templatedEmail.setCcRecipients(ccRecipients.toArray(new Address[0]));
                    try {
                        templatedEmail.sendEmail();
                    }
                    catch (MessagingException ex) {
                        logger.severeException(ex.getMessage(), ex);  // do not rethrow
                    }
                }
                else {
                    logger.warn("WARNING: No email recipients for task " + context.getTaskInstanceId() + " " + outcome);
                }
            }
        }
        catch (Exception ex) {
            logger.severeException(ex.getMessage(), ex);
            throw new ObserverException(-1, ex.getMessage(), ex);
        }
    }
356609
public Future<SendMessageResult> sendMessage(SendMessageRequest request,
                                                 AsyncHandler<SendMessageRequest, SendMessageResult> handler) {
        QueueBufferCallback<SendMessageRequest, SendMessageResult> callback = null;
        if (handler != null) {
            callback = new QueueBufferCallback<SendMessageRequest, SendMessageResult>(handler, request);
        }
        QueueBufferFuture<SendMessageRequest, SendMessageResult> future = sendBuffer.sendMessage(request, callback);
        future.setBuffer(this);
        return future;
    }
1270134
public void send(Email email) throws EmailException {
    synchronized (this) {
      EmailConnection connection = openConnection();
      connection.connect();
      
      connection.send(email);
      
      connection.close();
    }
  }
567881
public void fillEmail(final MultiPartEmail email) throws EmailException, IOException {
		email.setHostName(getHost());
		email.setSmtpPort(getSmtpPort());

		email.addTo(getTo());
		email.setFrom(getFrom());
		email.setSubject(getSubject());
		email.setMsg(getMsg());
		email.setSSLOnConnect(isSecured());
		if(this.bcc!=null) {
			String[] bccList = this.bcc.split(",");
			for (String bcc : bccList) {
				email.addBcc(bcc);
			}
		}
		if(this.cc!=null) {
			String[] ccList = this.cc.split(",");
			for (String cc : ccList) {
				email.addCc(cc);
			}
		}
		
		if (isRequiresAuthentication()) {
			email.setAuthentication(getUsername(), getPassword());
		}
		for (int i = 0; i < this.attachements.size(); i++) {
			final Attachment attachment = this.attachements.get(i);
			final ByteArrayDataSource ds = new ByteArrayDataSource(attachment.getData(), attachment.getMimeType());
			email.attach(ds, attachment.getName(), attachment.getDescription());
		}
	}
992571
@Override
    public void sendEmail(String subject, String body) {
        if (ArrayUtils.isEmpty(this.recipientEmailAddresses)) {
            log.warn("No recipients configured - no one to notify: ignoring...");
            return;
        }

        SendEmailRequest email = new SendEmailRequest();
        try {
            Destination destination = new Destination();
            destination.setToAddresses(Arrays.asList(this.recipientEmailAddresses));
            email.setDestination(destination);
            email.setSource(System.getProperty("notification.sender", "no-sender-specified"));
            Message message = new Message(new Content(subject), new Body(new Content(body)));
            email.setMessage(message);
            client.sendEmail(email);
            log.info("email sent: {}", email);
        } catch (Exception e) {
            log.error("failed to send " + email + ": " + e.getMessage(), e);
        }

    }
907056
public final T send() throws BoxException {
        Exception ex = null;
        T result = null;
        try {
            result = onSend();
        } catch (Exception e){
            ex = e;
        }

        // We catch the exception so that onSendCompleted can be called in case additional actions need to be taken
        onSendCompleted(new BoxResponse(result, ex, this));
        if (ex != null) {
            if (ex instanceof BoxException){
                throw (BoxException)ex;
            } else {
                throw new BoxException("unexpected exception ",ex);
            }
        }
        return result;
    }
1013575
async def send(self, request: Request[HTTPRequestType], **config: Any) -> Response[HTTPRequestType, AsyncHTTPResponseType]:
        
        pass
1052920
def send_message_sync(
        self,
        message: Message,
        sender: str = None,
        recipients: RecipientsType = None,
        mail_options: Iterable[str] = None,
        rcpt_options: Iterable[str] = None,
        timeout: DefaultNumType = _default,
    ) -> SendmailResponseType:
        
        return self._run_sync(
            self.send_message,
            message,
            sender=sender,
            recipients=recipients,
            mail_options=mail_options,
            rcpt_options=rcpt_options,
            timeout=timeout,
        )
437607
public void cancel(ResponseCallback responseCallback) {
    // To avoid creating an extra message, we adopt the convention that writing the callback
    // directly means cancellation
    writeCoalescer.writeAndFlush(channel, responseCallback).addListener(UncaughtExceptions::log);
  }
161320
public void send(final Message msg) throws MailException {
		Transport transport = null;
		try {
			if (log.isDebugEnabled()) {
				log.debug("Sending mail message [subject={}, recipients={}]", msg.getSubject(),
						on(", ").join(msg.getAllRecipients()));
			}
			transport = sessionProvider.get().getTransport();
			transport.connect();
			transport.sendMessage(msg, msg.getAllRecipients());
		} catch (MessagingException ex) {
			throw new MailException("Error sending mail message", ex);
		} finally {
			try {
				transport.close();
			} catch (MessagingException ex) {
				log.error(ex.getMessage(), ex);
			}
		}
	}