Esempio n. 1
0
def sendEmailByDefault(subject, plainText, htmlText):
    authInfo = {}
    authInfo['server'] = mailutil.get_smtp_server()
    authInfo['user'] = mailutil.get_sent_user()
    authInfo['password'] = mailutil.get_sent_password()
    fromAdd = authInfo['user']
    toAdd = mailutil.get_mail_to()
    sendEmail(authInfo, fromAdd, toAdd, subject, plainText, htmlText)
Esempio n. 2
0
def sendEmailByDefault(subject, plainText, htmlText):
    authInfo = {}
    authInfo['server'] = mailutil.get_smtp_server()
    authInfo['user'] = mailutil.get_sent_user()
    authInfo['password'] = mailutil.get_sent_password()
    fromAdd = authInfo['user']
    toAdd = mailutil.get_mail_to()
    sendEmail(authInfo, fromAdd, toAdd, subject, plainText, htmlText)
Esempio n. 3
0
    smtp = smtplib.SMTP()
    #设定调试级别,依情况而定
    smtp.set_debuglevel(1)
    smtp.connect(server)
    smtp.login(user, passwd)
    smtp.sendmail(strFrom, toAdd, msgRoot.as_string())
    smtp.quit()
    return

def sendEmailByDefault(subject, plainText, htmlText):
    authInfo = {}
    authInfo['server'] = mailutil.get_smtp_server()
    authInfo['user'] = mailutil.get_sent_user()
    authInfo['password'] = mailutil.get_sent_password()
    fromAdd = authInfo['user']
    toAdd = mailutil.get_mail_to()
    sendEmail(authInfo, fromAdd, toAdd, subject, plainText, htmlText)

if __name__ == '__main__' :
    authInfo = {}
    authInfo['server'] = mailutil.get_smtp_server()
    authInfo['user'] = mailutil.get_sent_user()
    authInfo['password'] = mailutil.get_sent_password()
    fromAdd = authInfo['user']
    toAdd = mailutil.get_mail_to()
    print toAdd
    subject = 'title'
    plainText = '这里是普通文本'
    htmlText = '<B>HTML文本</B>'
    sendEmail(authInfo, fromAdd, toAdd, subject, plainText, htmlText)
Esempio n. 4
0
    smtp.set_debuglevel(1)
    smtp.connect(server)
    smtp.login(user, passwd)
    smtp.sendmail(strFrom, toAdd, msgRoot.as_string())
    smtp.quit()
    return


def sendEmailByDefault(subject, plainText, htmlText):
    authInfo = {}
    authInfo['server'] = mailutil.get_smtp_server()
    authInfo['user'] = mailutil.get_sent_user()
    authInfo['password'] = mailutil.get_sent_password()
    fromAdd = authInfo['user']
    toAdd = mailutil.get_mail_to()
    sendEmail(authInfo, fromAdd, toAdd, subject, plainText, htmlText)


if __name__ == '__main__':
    authInfo = {}
    authInfo['server'] = mailutil.get_smtp_server()
    authInfo['user'] = mailutil.get_sent_user()
    authInfo['password'] = mailutil.get_sent_password()
    fromAdd = authInfo['user']
    toAdd = mailutil.get_mail_to()
    print toAdd
    subject = 'title'
    plainText = '这里是普通文本'
    htmlText = '<B>HTML文本</B>'
    sendEmail(authInfo, fromAdd, toAdd, subject, plainText, htmlText)