python发送邮件群发软件_python使用tkinter写的邮件群发软件-python图形界面编程

学习python不久,学软件编程,最有兴趣的就是图形界面编程了。

用生涩的代码,写下了这个简陋的邮件群发程序。

Tkinter这个GUI模块,windows下安装了python环境的默认已经安装了这个模块,不用另外下载安装

见笑了

#-*- coding:utf-8 -*-

#file:smtp.py

import Tkinter #GUI图形界面模块

import smtplib #邮件smtplib模块

from email.mime.text import MIMEText #邮件MIMEText

from ConfigParser import ConfigParser #配置文件模块

import os

import tkFileDialog

import re

class Window:

def __init__(self, root):

#Label标签

Host = http://www.doczj.com/doc/953fb6195a8102d276a22f86.htmlbel(root, text = '服务器')

Port = http://www.doczj.com/doc/953fb6195a8102d276a22f86.htmlbel(root, text = '端口')

User = http://www.doczj.com/doc/953fb6195a8102d276a22f86.htmlbel(root, text = '用户名')

Passwd = http://www.doczj.com/doc/953fb6195a8102d276a22f86.htmlbel(root, text = '密码')

Subject = http://www.doczj.com/doc/953fb6195a8102d276a22f86.htmlbel(root, text = '主题')

To = http://www.doczj.com/doc/953fb6195a8102d276a22f86.htmlbel(root, text = '收件人')

MailFile = Tkinter.Button(root, text = '浏览', command = self.MailFile) #调用MailFile函数

#定义Label的位置

Host.place(x = 5, y = 5)

Port.place(x = 200, y = 5)

User.place(x = 5, y = 30)

Passwd.place(x = 200, y = 30)

Subject.place(x = 5, y = 55)

To.place(x = 5, y = 83)

#定义浏览按钮的位置

MailFile.place(x = 345, y = 80)

#Entry文本框

self.entryHost = Tkinter.Entry(root)

self.entryUser = Tkinter.Entry(root)

self.entryPasswd = Tkinter.Entry(root, show = '*')

self.entryTo = Tkinter.Entry(root, width = 40)

self.entryPort = Tkinter.Entry(root)

self.entrySub = Tkinter.Entry(root, width = 40)

#读取配置文件

config = ConfigParser()

config.read('smtp.conf')

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值