Skip to main content

Mailshot is a simple package to send email via Gmail.

Project description

Mailshot

Mailshot is a wrapper around smtplib's SMTP connection and simplifying sending of email using python.


Example


from mailshot import Mailshot

mailshot = Mailshot()
mailshot.compose("to@example.com", subject="Example")
mailshot.send()

Install


Run the following command

pip install mailshot

Username & Password


Usage of application specific passowrd is recommended. Store it in the environment variable. Use EMAIL for storing the Gmail address and PASSWORD for storing application-specific passwords (recommended).


If you want to store the password in the script, you can do it as follows.


from mailshot import Mailshot

mailshot = Mailshot("u@example.com", "password")

The best way to can take the password as an input.


from mailshot import Mailshot

password = input("Password : ")

mailshot = Mailshot("u@example.com", password)

If you don’t want your password to show on your screen when you type it, you can import the getpass module and use .getpass() instead for blind input of your password.


Usage


compose() method takes following arguments

  • to (required) : A string or list of strings of recipients.
  • cc (optional) : A string or list of strings of recipients of the carbon copy.
  • bcc (optional) : A string or list of strings of recipients of the blind carbon copy.
  • subject (optional) : A subject string.
  • text (optional) : A text string.
  • html (optional) : A html string to render.
  • files (optional) : A file or list of files.

Example


from mailshot import Mailshot

mailshot = Mailshot()

mailshot.compose("to@example.com", cc=["one@example.com", "two@example.com"], subject="Test Mail", text="Test Mail", files=["test.pdf", "test.png"])

Features


Mailshot allows you to

  • Send mail to bulk of recipients.
  • Send text and HTML body.
  • Send bulk of files.
  • Send the personalised email.

Author


Mailshot is developed by Rohan Pednekar.


License


Envelopes is licensed under the MIT License.


Source Code


Source code is available on GitHub at: rohan-pednekar/mailshot.


Issues


To file issue reports and feature requests use the project's issue tracker on GitHub.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mailshot-1.0.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

mailshot-1.0.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file mailshot-1.0.0.tar.gz.

File metadata

  • Download URL: mailshot-1.0.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for mailshot-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d4372089c53eaa4ef06984d926f9d6a6458de7c4e9b85573d78a9eae2f0435f4
MD5 1b10576a7bb6d13444e3828d0d6c3e46
BLAKE2b-256 1c2b062b59b6c525e87b195d4383499704d0358b04431b1f2630325b5623eac4

See more details on using hashes here.

File details

Details for the file mailshot-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mailshot-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for mailshot-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 418bdbb4b4ec4a5f9708b99224bc0312f19a5b8142f3cdcf28421e3df70a82b2
MD5 c69256a497f3c2d3bfbaed40f2f321df
BLAKE2b-256 97c41e75a96627aa9454a2aa076580910fc9bf1e9a900814fe42b5b3c062ded7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page