Product
Docs
Resources
Log In

Error: Module smtplib Has No Attribute SMTP

What's Causing This Error?

This error occurs when Python discovers a circular dependency with the smtplib module.

For example, if your email sending script were named smtplib.py or email.py, Python would try to import your file when it executes the import statement for the smtplib library. As a result, it creates a partially initialized module, and if your script does not have an attribute named smtp, you will run into this error.

Solution - Here's How To Resolve It

To resolve this error, rename your email sending script to a name apart from smtplib.py or email.py, as these are internal script files that make up the smtplib module. Doing so would help Python import the correct library and resolve the error.

Other Common SMTPLIB Errors (and Solutions)

View all errors

Build your first notification in minutes

Send up to 10,000 notifications every month, for free.

Email & push notification

Build your first notification in minutes

Send up to 10,000 notifications every month, for free.

Email & push notification

Product

Pricing

Providers

Developers

Documentation

API

Libraries

Status

© 2022 Courier. All rights reserved.