# -*- coding: UTF-8 -*-

from email.mime.text import MIMEText
from pyeole.process import system_out

def send_mail(mailfrom, mailto, subject, message):
    msg = MIMEText(message)
    msg['subject'] = subject
    msg['From'] = mailfrom
    msg['To'] = mailto
    ret = system_out(['/usr/sbin/sendmail', '-t'], stdin=msg.as_string())
    return ret

