Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- import smtplib
- import os
- import getpass
- import sys
- from PIL import ImageTk, Image
- import tkinter.messagebox
- from smtplib import SMTPException, SMTPAuthenticationError
- import string
- import base64
- import sspi
- import getpass
- p = getpass.getpass()
- def raskemkood():
- inputI = text1.get("1.0",END)
- print(inputI)
- inputA = text2.get("1.0",END)
- print(inputI)
- u = getpass.getuser()
- print(u +"@stadtwerke-lehrte.de")
- msg = "\r\n".join([
- "From: alvet@stadtwerke-lehrte.de",
- "To: saks@stadtwerke-lehrte.de",
- "Subject:" +inputA,
- "",
- inputI
- ])
- toaddrs = 'saks@stadtwerke-lehrte.de'
- fromaddr = (u +"@stadtwerke-lehrte.de")
- username = u
- password = p
- server = smtplib.SMTP('exchange2016:587')
- server.ehlo()
- server.starttls()
- server.login(username,password)
- server.sendmail(fromaddr, toaddrs, msg)
- server.quit()
- sent()
- def sent():
- tkinter.messagebox.showinfo("Ticket Sent", "Your ticket has been sent to the support team!")
- root.destroy()
- root= Tk()
- #aken
- root.title("Ticket")
- root.geometry("576x235")
- root.iconbitmap('favicon.ico')
- root.resizable(0, 0)
- #disain
- image123 = Image.open("iluspilt.png")
- pilt = ImageTk.PhotoImage(image123)
- label3 = Label(root, image=pilt).place(x=316, y=60)
- image123 = image123.resize((10, 10), Image.ANTIALIAS)
- image4 = Image.open("jeb.png")
- pilt2 = ImageTk.PhotoImage(image4)
- label4 = Label(root, image= pilt2).place(x= 6, y=2)
- image4 = image4.resize((1, 1), Image.ANTIALIAS)
- #text ja nupp
- frame1=Frame(root)
- frame1.grid()
- w = Label(frame1, text=" Insert your problem:")
- w.pack()
- nupp1 = Button(root, text="Send", command = raskemkood)
- nupp1.place(x=336,y=202)
- #Menüüriba
- variable = StringVar(root)
- variable.set("Problem") # default value
- e = OptionMenu(root, variable, "Problem", "Bestellung", "Umzug", "Notfall")
- e.place(x=5,y=26)
- #input
- text1 = Text(root, width = 40, height = 10)
- text1.grid()
- text1.place(x=6, y=65)
- #input2
- text2 = Text(root, width = 28, height = 1)
- text2.grid()
- text2.place(x=100, y=31)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement