1 Star 1 Fork 0

binzhijie/学生会邮件发送软件

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.py 2.12 KB
一键复制 编辑 原始数据 按行查看 历史
binzhijie 提交于 2023-12-29 20:58 . add
from tkinter import *
from tkinter import messagebox
from go_mail import go_mail
from configparser import ConfigParser
def message():
msg = go_mail(Server_Entry.get(),From_Entry.get(),Passwd_Entry.get())
a=msg.go_mail(To_Entry.get(),Title_Entry.get(),Content_Entry.get('1.0','end'))
if a==True:
messagebox.showinfo('Tips:','发送成功!')
Title_Entry.delete(0,END)
Content_Entry.delete('1.0','end')
window.update()
else:
messagebox.showinfo('Tips:','发送失败!')
window = Tk()
window.title('邮件发送软件')
window.geometry('500x300')
window.resizable(0,0)
zhuti = Label(window, text='邮件发送软件', font=('黑体',20))
zhuti.place(x=150,y=0)
From_text = Label(window, text='发件人:',font=('Arial',15))
From_text.place(x=0,y=40)
From_Entry = Entry(window)
From_Entry.place(x=80,y=45)
Passwd_text = Label(window, text='密码:',font=('Arial',15))
Passwd_text.place(x=0,y=80)
Passwd_Entry = Entry(window,show='*')
Passwd_Entry.place(x=80,y=85)
Server_text = Label(window,text='服务器:',font=('Arial',15))
Server_text.place(x=0,y=120)
Server_Entry = Entry(window)
Server_Entry.place(x=80,y=125)
To_text = Label(window, text='收件人:',font=('Arial',15))
To_text.place(x=0,y=160)
To_Entry = Entry(window)
To_Entry.place(x=80,y=165)
Title_text = Label(window,text='主题:',font=('Arial',15))
Title_text.place(x=240,y=40)
Title_Entry = Entry(window)
Title_Entry.place(x=310,y=45)
Content_text = Label(window,text='内容:',font=('Arial',15))
Content_text.place(x=240,y=80)
Content_Entry = Text(window,width=30,height=10)
Content_Entry.place(x=250,y=110)
Sending_Button = Button(window,text='发送',width=6,command=lambda:message())
Sending_Button.place(x=400,y=260)
config = ConfigParser()
config.read('config.ini',encoding='gbk')
From_Entry.insert('0',config['autofill']['User'])
Passwd_Entry.insert('0',config['autofill']['Password'])
Server_Entry.insert('0',config['autofill']['Server'])
To_Entry.insert('0',config['autofill']['Recipient'])
Title_Entry.insert('0',config['autofill']['Subject'])
Content_Entry.insert('0.0',config['autofill']['Content'])
window.mainloop()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/binzhijie/EmailToXueshenghui.git
git@gitee.com:binzhijie/EmailToXueshenghui.git
binzhijie
EmailToXueshenghui
学生会邮件发送软件
master

搜索帮助