zoukankan      html  css  js  c++  java
  • 催收分案数据

    催收分案数据,邮箱开启smtp服务

    import pandas as pd
    import smtplib 
    from email.mime.multipart import MIMEMultipart 
    from email.mime.text import MIMEText 
    from email.mime.image import MIMEImage 
    from email.header import Header 
    from email.mime.multipart import MIMEMultipart
    from email.mime.text import MIMEText
    from email.mime.application import MIMEApplication
    import os
    from email import encoders 
    import time
    
    
    ttt=''' fagdfa 
    '''
    
    
    def sendmail(receiverlist,cclist,subject,content,filename):
    
        sender = 'zichanguanlizhongxin@carcredit.com.cn'
        smtpserver = 'smtp.exmail.qq.com'
        username ='zichanguanlizhongxin@carcredit.com.cn'
        password=''
    
        h = Header('资产管理中心', 'utf-8')
        h.append('<zichanguanlizhongxin@carcredit.com.cn>', 'ascii')
        
        msg = MIMEMultipart('mixed') 
        msg['Subject'] = Header(subject, 'utf-8')
        msg['From'] =h
        msg['To'] = ','.join(receiverlist)
        msg['Cc'] = ','.join(cclist)
     
        msg.attach(MIMEText(content, 'html', 'utf-8'))
    
    
        for i in range(len(filename)):
    
            attfile = filename[i]
            basename = os.path.basename(attfile)  
            fp = open(attfile, 'rb')  
            att = MIMEText(fp.read(), 'base64', 'utf-8')  
            att["Content-Type"] = 'application/octet-stream'  
            att.add_header('Content-Disposition', 'attachment',filename=('gbk', '', basename))  
        
            msg.attach(att)    
    
    
        smtp = smtplib.SMTP()
        # smtp.set_debuglevel(1)
    
        smtp.connect(host=smtpserver,port=25)
        
    
        smtp.login(username, password)
    
        smtp.sendmail(sender, receiverlist+cclist, msg.as_string())
        smtp.quit()
    
    
    sendmail(receiverlist=["zhangtianlong@carcredit.com.cn"],cclist=[],subject="ff",content=ttt,filename=[])
  • 相关阅读:
    金融市场的初步了解
    今天参加了一个猎头实践
    前端面试
    web前端 浏览器私有前缀
    背景渐变
    移动web开发之响应式开发
    移动WEB开发之rem适配布局
    flex布局
    常见快捷方式
    virtual
  • 原文地址:https://www.cnblogs.com/nick477931661/p/11493990.html
Copyright © 2011-2022 走看看