Skip to main content

A simple email sender utility

Project description

PyCourrier

PyCourrier is a Python package that simplifies composing and sending emails using SMTP. This package allows you to connect to an SMTP server, set up email content (including plain text, HTML, and attachments), specify recipients, and send emails seamlessly.

Features

  • Connect to SMTP servers (supports both SSL and TLS connections).
  • Compose emails with plaintext, HTML, and attachments.
  • Set multiple recipients for each email.
  • Easily send emails to all recipients with a single function call.

Installation

You can install pycourrier using pip:

pip install pycourrier

Usage

Here's a quick guide on how to use MailSender:

from pycourrier import MailSender

# Initialize MailSender with your SMTP server credentials
mailer = MailSender(in_username='your_email@gmail.com', in_password='your_password')

# Set email message content
mailer.set_message(
    in_subject='Hello from MailSender!',
    in_plaintext='This is the plain text content of the email.',
    in_from='your_email@gmail.com',
    in_htmltext='<p>This is the HTML content of the email.</p>'
)

# Add recipients
mailer.set_recipients(['recipient1@example.com', 'recipient2@example.com'])

# Send the email to all recipients
mailer.connect()  # Connect to the SMTP server
mailer.send_all()  # Send the email and disconnect

Constructor Parameters

  • in_username: Your email address used for SMTP login.
  • in_password: Your Generated app password.
  • in_server: Tuple containing the SMTP server address and port (default is Gmail).
  • use_SSL: Boolean indicating whether to use SSL (True) or TLS (False, default) for the connection. Methods
  • set_message: Compose the email message with subject, plaintext, HTML content, and optional attachments.
  • set_recipients: Set the list of email recipients.
  • add_recipient: Add a single recipient to the list of recipients.
  • connect: Connect to the SMTP server.
  • disconnect: Disconnect from the SMTP server.
  • send_all: Send the composed email to all recipients.

Contribution

Contributions to pycourrier are welcome! If you encounter any issues or have suggestions for improvements, please open an issue on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

pycourrier-0.1.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycourrier-0.1.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pycourrier-0.1.1.tar.gz.

File metadata

  • Download URL: pycourrier-0.1.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for pycourrier-0.1.1.tar.gz
Algorithm Hash digest
SHA256 effd0eaf06e74ff819becbf8551ef39a687a13d8f6e349a1294d6f1ecb72aae1
MD5 4c5b87e60dae1a393f42c7496d528dde
BLAKE2b-256 4bf324a0feca959c6fd3b60d271bc882dfc43a9afcdbaa84f122907e2502ac11

See more details on using hashes here.

File details

Details for the file pycourrier-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pycourrier-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for pycourrier-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0c6d84f5d8ffd330bda551f8b53bc7fbc04f44633026b34f6c918cff787bc5a0
MD5 081a99dabf32166c10e97afb61e013ad
BLAKE2b-256 5328b38053151e7554c4c3f8121bcd085f73a4a5253a2bedca757e153c5cd215

See more details on using hashes here.

Supported by

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