Error Guide
This error occurs in Python when you do not import the smtplib library in your email sending script.
Import the smtplib module into your Python script to resolve this error, as shown below.
1 2 3 4 5 6import smtplib # import smtp library in your Python script to fix the error. # Replace with your email sending code # Sample: Testing a connection to Google SMTP server session = smtplib.SMTP('smtp.gmail.com',587) print(session)
View all errors
© 2026 Courier. All rights reserved.