def send_msg(name, recipient, subject, sender, profile, use_ssl='True'):
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}
    if __opts__['test']:
        ret['comment'] = 'Need to send message to {0}: {1}'.format(
            recipient,
            name,
        )
        return ret
    command = __salt__['smtp.send_msg'](
        message=name,
        recipient=recipient,
        profile=profile,
        subject=subject,
        sender=sender,
        use_ssl=use_ssl,
    )

    if command:
        ret['result'] = True
        ret['comment'] = 'Sent message to {0}: {1}'.format(recipient, name)
    else:
        ret['result'] = False
        ret['comment'] = 'Unable to send message to {0}: {1}'.format(recipient, name)
    return ret
Send a message via SMTP
dataset/ETHPy150Open saltstack/salt/salt/states/smtp.py/send_msg