Skip to content

HYKANTUS/pySMTP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pySMTP

An easy-to-use python library to send emails within seconds.

Based on the pre-installed smtplib library.

See the pypi project here

IMPORTANT

Gmail users must turn on 'Less secure app access' in order to avoid smtplib errors. You can turn it on like so:

  • go to 'Manage your google account'

  • then click on the 'security' tab

  • scroll down until you find 'Less secure app access' and click on the 'Turn on access' button

  • you should be asked to 'Allow less secure apps' again. turn it on.

NOTE: turning this feature is generally not a good idea as it isn't safe (see why online)

I suggest you continue reading the 'SAFER ALTERNATIVE' below.

SAFER ALTERNATIVE:

You can use an app password. See how to make one below:

  • go to 'Manage your google account'

  • then click on the 'security' tab

  • find 'Signing into Google'

  • click on 'App passwords'

  • type out your password

  • change 'Select app' to 'Mail'

  • change 'Select device' to the device you are currently using

  • Hit 'Generate' to get your password

Use the newly-generated password in place of sender_password

Usage

import pySMTP
pySMTP.send_email(sender_email, sender_password, receiver_email, email_subject, email_body)

Example

import pySMTP
pySMTP.send_email('[email protected]', 'my_password', '[email protected]', 'Test', 'hello. I sent this email with python!')

Help function

import pySMTP
pySMTP.help()

Requirements

pre-installed smtplib library.

Credits

Made by HYKANTUS

About

An easy-to-use python library to send emails within seconds

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages