Creates an email alarm.
@param trigger the trigger
@param subject the email subject
@param body the email body
@param recipients the email address(es) to send the alert to
@return the alarm
194939
public static VAlarm email(Trigger trigger, String subject, String body, String... recipients) {
		return email(trigger, subject, body, Arrays.asList(recipients));
	}
871511
public Task<AwsSesSendResult> sendEmail(
      @NonNull final String to,
      @NonNull final String from,
      @NonNull final String subject,
      @NonNull final String body) {
    return dispatcher.dispatchTask(new Callable<AwsSesSendResult>() {
      @Override
      public AwsSesSendResult call() {
        return proxy.sendEmail(to, from, subject, body);
      }
    });
  }
795151
public function mass_alert($email_table = '', $email_column = '', $emeil_where = '', $subject = '', $message = '', $link = false,
        $field = false, $value = false, $mode = 'all')
    {
        $table = $this->_get_table('mass_alert');
        $field = $this->table . '.' . $field;
        if ($mode == 'all' or $mode == 'create')
            $this->mass_alert_create[] = array(
                'email_table' => $email_table,
                'email_column' => $email_column,
                'where' => $emeil_where,
                'subject' => $subject,
                'message' => $message,
                'link' => $link,
                'field' => $field,
                'value' => $value,
                'table' => $table);
        if ($mode == 'all' or $mode == 'edit')
            $this->mass_alert_edit[] = array(
                'email_table' => $email_table,
                'email_column' => $email_column,
                'where' => $emeil_where,
                'subject' => $subject,
                'message' => $message,
                'link' => $link,
                'field' => $field,
                'value' => $value,
                'table' => $table);

        return $this;
    }
449780
public static Predicate<MailMessage> forSubject(final Pattern subjectPattern) {
		return new Predicate<MailMessage>() {
			@Override
			public boolean apply(final MailMessage input) {
				return subjectPattern.matcher(input.getSubject()).matches();
			}

			@Override
			public String toString() {
				return String.format("subject to match pattern '%s'", subjectPattern);
			}
		};
	}
979271
public List<SendMessageResult> sendMessage(List<SignalServiceAddress>             recipients,
                                             List<Optional<UnidentifiedAccessPair>> unidentifiedAccess,
                                             SignalServiceDataMessage               message)
      throws IOException, UntrustedIdentityException
  {
    byte[]                  content            = createMessageContent(message);
    long                    timestamp          = message.getTimestamp();
    List<SendMessageResult> results            = sendMessage(recipients, getTargetUnidentifiedAccess(unidentifiedAccess), timestamp, content, false);
    boolean                 needsSyncInResults = false;

    for (SendMessageResult result : results) {
      if (result.getSuccess() != null && result.getSuccess().isNeedsSync()) {
        needsSyncInResults = true;
        break;
      }
    }

    if (needsSyncInResults || (isMultiDevice.get())) {
      byte[] syncMessage = createMultiDeviceSentTranscriptContent(content, Optional.<SignalServiceAddress>absent(), timestamp, results);
      sendMessage(localAddress, Optional.<UnidentifiedAccess>absent(), timestamp, syncMessage, false);
    }

    return results;
  }
1240389
public function sendEmail($subject = '', $body = '')
    {
        $mail             = new BaseMail();
        $mail->DEBUG      = $this->DEBUG;
        $mail->debugLevel = $this->loggerLevel;
        $mail->loggerPath = $this->loggerPath;
        $mail->__construct();
        $mail->setConfig($this->email_config['config']);
        $mail->setSubject($subject);
        $mail->setTo($this->email_config['list']['to']);
        if (isset($this->email_config['list']['cc'])) {
            $mail->setCc($this->email_config['list']['cc']);
        }
        if (isset($this->email_config['list']['bcc'])) {
            $mail->setCc($this->email_config['list']['bcc']);
        }
        $mail->setContentType('text/html');
        $mail->setBody($body);

        return $mail->send();
    }
38727
public static Predicate<MailMessage> forSubjectAndBody(final String subjectPattern, final String bodyPattern) {
		return forSubjectAndBody(Pattern.compile(subjectPattern), Pattern.compile(bodyPattern));
	}
928948
private void email(JsonSimple response, String oid, String text) {
		JsonObject object = newMessage(response,
				EmailNotificationConsumer.LISTENER_ID);
		JsonObject message = (JsonObject) object.get("message");
		message.put("to", emailAddress);
		message.put("body", text);
		message.put("oid", oid);
	}
1067465
def email_user(
        self, subject, message, from_email=settings.DEFAULT_FROM_EMAIL, **kwargs
    ):
        
        receiver = self.email
        if settings.EMAIL_OVERRIDE_ADDRESS:
            receiver = settings.EMAIL_OVERRIDE_ADDRESS

        send_mail(subject, message, from_email, [receiver], **kwargs)
341398
protected void sendWardenEmailToUser(NotificationContext context, SubSystem subSystem) {
        EntityManager em = emf.get();
        PrincipalUser user = getWardenUser(context.getAlert().getName());
        SuspensionRecord record = SuspensionRecord.findByUserAndSubsystem(em, user, subSystem);
        Set<String> to = new HashSet<>();

        to.add(user.getEmail());

        String subject = "Warden Email Notification";
        StringBuilder message = new StringBuilder();

        message.append(MessageFormat.format("<p>{0} has been suspended from the Argus system for violating the following policy</p>",
                user.getUserName()));
        message.append(MessageFormat.format("Subsystem: {0}", subSystem.toString()));
        message.append(MessageFormat.format("<br>Policy: {0}",
                context.getAlert().getName().replace(WARDEN_ALERT_NAME_PREFIX + user.getUserName() + "-", "")));
        message.append(MessageFormat.format("<br>Threshold: {0}", context.getAlert().getTriggers().get(0).getThreshold()));
        message.append(MessageFormat.format("<br>Triggering Value: {0}", context.getTriggerEventValue()));
        if (record.getSuspendedUntil() == -1) {
            message.append("<br> You have been suspended indefinitely");
        } else {
            message.append(MessageFormat.format("<br>Reinstatement Time: {0}", DATE_FORMATTER.get().format(new Date(record.getSuspendedUntil()))));
        }
        _mailService.sendMessage(to, subject, message.toString(), "text/html; charset=utf-8", MailService.Priority.HIGH);
        to.clear();
        to.add("argus-admin@salesforce.com");
        message.append("<p><a href='").append(getAlertUrl(context.getAlert().getId())).append("'>Click here to view alert definition.</a><br/>");
        _mailService.sendMessage(to, subject, message.toString(), "text/html; charset=utf-8", MailService.Priority.HIGH);
    }
743289
def send_email(subject, message, sender, recipients, image_png=None):
    
    notifiers = {
        'ses': send_email_ses,
        'sendgrid': send_email_sendgrid,
        'smtp': send_email_smtp,
        'sns': send_email_sns,
    }

    subject = _prefix(subject)
    if not recipients or recipients == (None,):
        return

    if _email_disabled_reason():
        logger.info("Not sending email to %r because %s",
                    recipients, _email_disabled_reason())
        return

    # Clean the recipients lists to allow multiple email addresses, comma
    # separated in luigi.cfg
    recipients_tmp = []
    for r in recipients:
        recipients_tmp.extend([a.strip() for a in r.split(',') if a.strip()])

    # Replace original recipients with the clean list
    recipients = recipients_tmp

    logger.info("Sending email to %r", recipients)

    # Get appropriate sender and call it to send the notification
    email_sender = notifiers[email().method]
    email_sender(sender, subject, message, recipients, image_png)
1123431
@Override
    public SendObjectMessage recipients(Collection<? extends ApiBaseUser> recipients) {
        for(ApiBaseUser user : recipients) {
            this.recipients.add(user.getName());
        }
        return this;
    }
1319945
public static void sendTextEmail(String to, String from, String subject, String msg, final ServerSetup setup) {
        sendMimeMessage(createTextEmail(to, from, subject, msg, setup));
    }
180978
public static void sendEmail(String email, String subject, String emailBody) {
        Intent emailIntent = new Intent(Intent.ACTION_SEND);
        emailIntent.setType("message/rfc822");
        emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{email});
        emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
        emailIntent.putExtra(Intent.EXTRA_TEXT, emailBody);

        emailIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        try {
            QuickUtils.getContext().startActivity(emailIntent);
        } catch (android.content.ActivityNotFoundException ex) {
            QuickUtils.system.toast("There are no email clients installed.");
        }
    }
1010226
public static void sendMessage(final Context context, final String subject, final String body, final String toAddress) {
        final Intent intent;
        if (toAddress != null && !"".equals(toAddress)) {
            intent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", toAddress, null));
        } else {
            intent = new Intent(Intent.ACTION_SEND);
        }
        intent.setType("text/plain");
        if (subject != null && !"".equals(subject)) {
            intent.putExtra(Intent.EXTRA_SUBJECT, subject);
        }
        if (body != null && !"".equals(body)) {
            intent.putExtra(Intent.EXTRA_TEXT, body);
        }
        context.startActivity(Intent.createChooser(intent, "Send message..."));
    }
244936
def send_email(recipient,
               subject,
               message,
               sender="ploneintranet@netsight.co.uk"):
    
    try:
        api.portal.send_email(
            recipient=recipient,
            sender=sender,
            subject=subject,
            body=message)
    except ValueError, e:
        log.error("MailHost error: {0}".format(e))
1194963
public void sendEmail(final List<String> emailList, final String subject, final String body) {
    if (emailList != null && !emailList.isEmpty()) {
      final EmailMessage message = super.createEmailMessage(subject, "text/html", emailList);
      message.setBody(body);
      sendEmail(message, true, "email message " + body);
    }
  }