Answer the question
In order to leave comments, you need to log in
AttributeError: module 'smtplib' has no attribute 'SMPT' how to solve?
I can't find a solution to this error, please help!
The code is like this, I’ll say right away that I found it in a training video:
import smtplib
def send_email(message):
sender = "[email protected]"
password = "скрыто"
server = smtplib.SMPT("smpt.gmail.com", 587)
server.starttls()
try:
server.login(sender, password)
server.sendmail(sender, sender, message)
return "yess sirr"
except Exception as _ex:
return f"{_ex}\n Check ur login or password"
def main():
message = input('Ввод сообщения:')
print(send_email(message = message))
if __name__ == '__main__':
main()
Traceback (most recent call last):
File "D:\!all\rm\sadasdfdf.py", line 28, in <module>
main()
File "D:\!all\rm\sadasdfdf.py", line 25, in main
print(send_email(message = message))
File "D:\!all\rm\sadasdfdf.py", line 11, in send_email
server = smtplib.SMPT("smpt.gmail.com", 587)
AttributeError: module 'smtplib' has no attribute 'SMPT'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question