Besoin d'aide pour régler les erreurs TypeError: 'type' object des not support a
Eeeee
-
yg_be Messages postés 23437 Date d'inscription Statut Contributeur Dernière intervention -
yg_be Messages postés 23437 Date d'inscription Statut Contributeur Dernière intervention -
Mais bref salutations
J'ai besoin d'aide pour régler cette erreur j'ai beau chercher je ne trouve aucune réponse essaie de faire un programme qui envoie des mail
Voici mon code
from tkinter import *
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
w = Tk()
w.title("not")
w.config(background='#000000')
msg = MIMEMultipart
def de():
msg['Form'] = "XX"
msg['To'] = "XX"
password = "XX"
msg['Subject'] = "test"
body = "test1"
msg.attach(MIMEText(body, 'html'))
server = smtplib.SMTP("stmp.gmail.com", 587)
server.starttls()
server.login(msg['From'], password)
server.sendmail(msg['From'], msg['To'], msg.as_string())
server.quit()
bot = Frame(w, bg='#000000')
butres = Button(bot, text="def", font=("Courrier", 20), bg='white', fg='#000000', command=de)
nom = Entry(bot, font=("Courrier", 60), bg='white', fg='#000000')
text = Label(bot, text="", font=("Courrier", 20), bg='#000000', fg='#FFFFFF')
bot.pack()
butres.pack()
nom.pack()
text.pack()
w.mainloop()
J'ai besoin d'aide pour régler cette erreur j'ai beau chercher je ne trouve aucune réponse essaie de faire un programme qui envoie des mail
Voici mon code
from tkinter import *
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
w = Tk()
w.title("not")
w.config(background='#000000')
msg = MIMEMultipart
def de():
msg['Form'] = "XX"
msg['To'] = "XX"
password = "XX"
msg['Subject'] = "test"
body = "test1"
msg.attach(MIMEText(body, 'html'))
server = smtplib.SMTP("stmp.gmail.com", 587)
server.starttls()
server.login(msg['From'], password)
server.sendmail(msg['From'], msg['To'], msg.as_string())
server.quit()
bot = Frame(w, bg='#000000')
butres = Button(bot, text="def", font=("Courrier", 20), bg='white', fg='#000000', command=de)
nom = Entry(bot, font=("Courrier", 60), bg='white', fg='#000000')
text = Label(bot, text="", font=("Courrier", 20), bg='#000000', fg='#FFFFFF')
bot.pack()
butres.pack()
nom.pack()
text.pack()
w.mainloop()
1 réponse
-
yg_be Messages postés 23437 Date d'inscription Statut Contributeur Dernière intervention Ambassadeur 1 588
bonjour,
avant tout:
1) tiens compte de ceci quand tu postes ton code: https://codes-sources.commentcamarche.net/faq/11288-les-balises-de-code
2) partage le message d'erreur complet.