1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > python发送邮件群发软件_python使用tkinter写的邮件群发软件-python图形界面编程

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

时间:2018-09-08 00:06:52

相关推荐

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 = /doc/953fb6195a8102d276a22f86.htmlbel(root, text = '服务器')

Port = /doc/953fb6195a8102d276a22f86.htmlbel(root, text = '端口')

User = /doc/953fb6195a8102d276a22f86.htmlbel(root, text = '用户名')

Passwd = /doc/953fb6195a8102d276a22f86.htmlbel(root, text = '密码')

Subject = /doc/953fb6195a8102d276a22f86.htmlbel(root, text = '主题')

To = /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')

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。