from smtplib import SMTP
from email.header import Header
from email.mime.text import MIMEText


def main():
    # 请自行修改下面的邮件发送者和接收者
    sender = 'sunhui@zhongfu.net'
    receivers = ['1161186762@qq.com', 'daersunhui@gmail.com']
    message = MIMEText('用Python发送邮件的示例代码.', 'plain', 'utf-8')
    message['From'] = Header('大锤', 'utf-8')
    message['To'] = Header('发放', 'utf-8')
    message['Subject'] = Header('示例代码实验邮件', 'utf-8')
    smtper = SMTP('smtp.zhongfu.net')
    print("qqq")
    # 请自行修改下面的登录口令
    smtper.login(sender, '密码')
    smtper.sendmail(sender, receivers, message.as_string())
    print('邮件发送完成!')


if __name__ == '__main__':
    main()