Skip to main content

No project description provided

Project description

Creating a README file is an essential part of documenting your Python project for PyPI and GitHub. A good README should provide clear instructions on how to install, configure, and use your software. Below is a template for your SMTPClient project:


CD Email

cd-email is a Python package that simplifies the process of sending emails via SMTP. It supports sending plain text emails, HTML emails, and emails with attachments. It also uses IMAP to receive emails too.

Features

  • Send plain text and HTML emails.
  • Attach files to your emails.
  • Support for SMTP servers with authentication.
  • Flexible and easy to use.

Installation

To install CD Email, you can use pip:

pip install cd-email

Usage

Import the SMTPClient class from the package and initialize it with your SMTP server details:

from cd_email.send_smtp import SMTPClient

client = SMTPClient("smtp.example.com", 587, "your_username", "your_password")

Sending a Simple Email

To send a simple email, use the send_email method:

client.send_email(
    sender="sender@example.com",
    recipients=["recipient@example.com"],
    subject="Test Subject",
    body_text="This is a simple text email."
)

Sending HTML Email

To send an HTML email, include the body_html parameter:

client.send_email(
    sender="sender@example.com",
    recipients=["recipient@example.com"],
    subject="Test HTML Email",
    body_html="<h1>This is an HTML email</h1>"
)

Sending an Email with Attachments

To send an email with attachments, include the attachments parameter with a list of file paths:

client.send_email(
    sender="sender@example.com",
    recipients=["recipient@example.com"],
    subject="Email with Attachments",
    attachments=["path/to/attachment1.txt", "path/to/attachment2.jpg"]
)

Requirements

  • Python 3.x
  • smtplib and email packages (standard library)

IMAP Python Client

A simple and straightforward IMAP client written in Python for interacting with IMAP servers. This client allows you to login, search, fetch, delete emails, and manage folders on an IMAP server.

Features

  • Connect to an IMAP server with SSL
  • Login and logout
  • Select IMAP folders
  • Search for emails with various criteria
  • Fetch full email content
  • Delete emails
  • List all folders
  • Close selected folder

Installation

Currently, this IMAP client is provided as a standalone Python class. You can integrate it into your project by copying the IMAPClient class from imap_client.py.

Usage

Here's a quick example of how to use the IMAPClient:

from cd_email.read_imap import IMAPClient

# Create an instance of the IMAPClient
client = IMAPClient("imap.example.com")

# Login with your credentials
if client.login("your@email.com", "yourpassword"):
    print("Logged in successfully!")

    # Select a folder (defaults to INBOX)
    client.select_folder("INBOX")

    # Search for all emails
    emails = client.search()

    # Fetch and print the subject of each email
    for email_id in emails:
        email = client.fetch_email(email_id)
        print(f"Subject: {email['subject']}")

    # Remember to logout
    client.logout()
else:
    print("Login failed.")


## Contributing

Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for more information.

## License

This project is licensed under the [MIT License](LICENSE).

## More documentation at:
[Code Docta](https://codedocta.com "Code Docta")

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

cd_email-0.0.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

cd_email-0.0.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file cd_email-0.0.1.tar.gz.

File metadata

  • Download URL: cd_email-0.0.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for cd_email-0.0.1.tar.gz
Algorithm Hash digest
SHA256 724f270261da162b43315a89c8ab3a30dfdb000627f9dcd9d2b8afe6767c06a0
MD5 692052e700ef72d5c68f4df90db37d12
BLAKE2b-256 b31e4770095c17a34cc843e111822a18c9e4ea7fa69044bb232a5971671c4b3e

See more details on using hashes here.

File details

Details for the file cd_email-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: cd_email-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for cd_email-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 820850ee42de60cb6184aaf846e0746ba495a3105ac8acae540ea4649fbe0295
MD5 89cd3d5761f6936bb4f13e2a0103de4f
BLAKE2b-256 29d7241a789a571890f5d9a10ef3154960c441dbd51b41edd3ef07d073a85a56

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