Besoin d'aide pour régler les erreurs TypeError: 'type' object des not support a

Eeeee - Modifié le 13 nov. 2021 à 18:20
yg_be Messages postés 23537 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 16 mai 2025 - 13 nov. 2021 à 21:09
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()
A voir également:

1 réponse

yg_be Messages postés 23537 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 16 mai 2025 Ambassadeur 1 581
13 nov. 2021 à 21:09
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.
0