title: How to configure label in tkinter
body: <p>I have this few lines code to send mail in <code>tkinter</code>, what i want to do is configure the label with <code>sending  in progress...</code> when the mail is sending but the label don't configure and until when error is output before the label is configured.</p>
  
  <p>I want the label to configure that mail is sending then when it's done configure <code>mail sent</code> </p>
  
  <pre><code>from tkinter import messagebox
  import smtplib
  from email.mime.text import MIMEText
  from email.mime.multipart import MIMEMultipart
  from email.mime.base import MIMEBase
  from email import encoders
  import socket
  import tkinter as tk
  
  
  
  
  def my_second_mail():
      try:
  
          l.config(text="sending  in progress...")
  
  
          FROMADDR = "my@gmail.com"
          PASSWORD = "22@201"
  
          TOADDR = ['@yahoo.com', '@gmail.com']
          CCADDR = ['fkfkf@gmail.com']
  
          # Create message container - the correct MIME type is multipart/alternative.
          msg = MIMEMultipart('alternative')
          msg['Subject'] = 'BACK UP FILES'
          msg['From'] = FROMADDR
          msg['To'] = ', '.join(TOADDR)
          msg['Cc'] = ', '.join(CCADDR)
  
          body = "mail test"
          msg.attach(MIMEText(body, 'plain'))
  
          filename = ['facebook.png']
  
          for n in filename:
            #  l.config(text="sending  in progress...")
              print(n)
              attachment = open(str(n), 'rb')
  
  
              part = MIMEBase('application', 'octet-stream')
              part.set_payload((attachment).read())
              encoders.encode_base64(part)
              part.add_header('Content-Disposition', "attachment; filename= " + n)
  
              msg.attach(part)
              server = smtplib.SMTP('smtp.gmail.com', 587)
              server.starttls()
              server.login(FROMADDR, PASSWORD)
  
              server.sendmail(FROMADDR, TOADDR + CCADDR, msg.as_string())
              server.quit()
  
  
          messagebox.showinfo("success", "mail sent", parent=root)
  
          l.config(text="mail sent...")
  
  
      except socket.gaierror:
          messagebox.showerror("no internet", "no internet connectivity")
  
  
  
  root = tk.Tk()
  root.geometry("600x400")
  
  canvas = tk.Canvas(root, width=200, height=200, background="dodger blue")
  canvas.pack(fill="both", expand=True)
  
  l = tk.Label(canvas, bg="dodger blue",  fg="white")
  l.place(x=250, y=20)
  
  b= tk.Button(canvas, text="send mail", command=my_second_mail, width=25, fg='dodger blue')
  b.place(x=220, y=330)
  
  root.mainloop()
  </code></pre>