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 6
import 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
Send up to 10,000 notifications every month, for free.
Get started for free
Send up to 10,000 notifications every month, for free.
Get started for free
© 2024 Courier. All rights reserved.