User needs to type in the password to send an email User has three attempts (locks you out for 10 seconds if you fail) to log in to send an email. Afterwards, you need to insert your username and password to send your message to someone of your will.


Any improvements that I can make? 

import smtplib
import time

def send_mail() :
    try :
        content = input("Type in your content :")
        mail = smtplib.SMTP('smtp.gmail.com', 587)
        mail.ehlo()
        mail.starttls()

        username = input("Username :")
        password = input("Password :")
        mail.login(username,password)
        receiver = input("Receiver : ")
        mail.sendmail(username, receiver, content)
        mail.close()

    except smtplib.SMTPException :
        print("Error. Mail was not sent.")
    else :
        print("Success. Mail sent.")


if __name__ == '__main__' :
    password = "password123"
    num_of_tries = 3
    input_password = input("Enter password")

    '3 attempts before locking you out for 10 seconds.'
    while password != input_password :
        num_of_tries -= 1
        if num_of_tries == 0 :
            print("Try again in 10 seconds")
            time.sleep(10)
            num_of_tries = 3

        input_password = input(str(num_of_tries) + " Attempts Remaining. Password : ")

    if password == input_password :
        print("Success.")
        send_mail()
def send_mail() :


Per PEP8, you wouldn't typically include a space before those colons. You should run your code through a linter.

password = input("Password :")


This is a big no-no. Never expose a user's password content on the screen if you can avoid it. Instead, use the built-in getpass which attempts to mask your input.

mail.close()


You should avoid doing this explicitly, and instead use mail in a with statement.

'3 attempts before locking you out for 10 seconds.'


This line has no effect. Perhaps you meant to write print here. Also, don't hard-code the 3 in the string; use num_of_tries.