I want to understand how to return to or repeat a set code in case an error occurs.
For example:
import smtpd
LoginE = input("What is the email you will be using? \n")
LoginP = input("what is the password of the email you will using? \n")
server = smtplib.SMTP_SSL("smtp.gmail.com", 465)
server.login( LoginE , LoginP)
I have tried to use the try function but it still will crash and tell me I have an error.
try? Because it's not in what you actually posted. docs.python.org/3/tutorial/errors.html explains how to handle errors.