def _send_email(name, email):
    config = __salt__['config.option']('splunk')
    email_object = config.get('email')
    if email_object:
        cc = email_object.get('cc')
        subject = email_object.get('subject')
        message = email_object.get('message').format(name, name, _generate_password(email), name)

        try:
            mail_process = subprocess.Popen(['mail', '-s', subject, '-c', cc, email], stdin=subprocess.PIPE)
        except Exception as e:
            log.error("unable to send email to {0}: {1}".format(email, str(e)))

        mail_process.communicate(message)

        log.info("sent account creation email to {0}".format(email))
send a email to inform user of account creation
dataset/ETHPy150Open saltstack/salt/salt/modules/splunk.py/_send_email