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=[])
  • 相关阅读:
    ArchLinux and LXDE and LXDM
    如何改变X:\Users\XXX的用户名称
    Windows 7 支持4GB以上内存破解工具下载
    Linux & Vim Command Wallpaper
    The easy way to execute sudo command in Python using subprocess.Popen
    C# DateTime 精确到秒/截断毫秒部分
    制约程序员"钱途"的两大最关键因素
    Oracle基本操作
    字符串处理【Delphi版】
    java学习路线的经验之谈
  • 原文地址:https://www.cnblogs.com/nick477931661/p/11493990.html
Copyright © 2011-2022 走看看