So i am experimenting with the SMTP module in python and the code i was using, wasnt working. i found a solution on stack overflow which literally was the same code as mine but worked. Can someone please find a difference or tell me why my code wasnt working my code is the second block
import smtplib
server = smtplib.SMTP('smtp.gmail.com',587)
server.ehlo()
server.starttls()
server.login('example@gmail.com','password')
server.sendmail('example@gmail.com','recipient@gmail.com','msg')
server.close()
print("SUCCESS")
import smtplib
server = smtplib.SMTP('smpt.gmail.com', 587)
server.ehlo()
server.starttls()
server.login('example@gmail.com','password')
server.sendmail('example@gmail.com','recipient@gmail.com','msg')
server.close()
print("SUCCESS")
there is no literal difference but the first one works and the second one doesnt