Skip to main content

An ultra-simple and SOLID Python library for sending emails with attachments and HTML or plain text support.

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Osmia

An ultra-simple and SOLID Python library for sending emails with attachments and HTML or plain text support.


✨ Features

  • Send emails with plain text or HTML
  • Easily add multiple attachments
  • SOLID-compliant architecture
  • Simple and clean interface

🚀 Installation

git clone https://github.com/Tina-1300/Osmia.git

example usage of library :

from Osmia.email_message import EmailMessage
from Osmia.email_config import EmailConfig

# Configuration de l'email
config = EmailConfig(
    smtp_server="smtp.gmail.com", # server smtp
    smtp_port=587, # port smtp
    login="email@gmail.com", # email de l'envoyeur 
    password="mot de passe d'application" # password d'application
)

# Création du mail
email = EmailMessage(
    config.smtp_server,
    config.smtp_port,
    config.login,
    config.password
)

html_message = """
<html>
    <body>
        <h1 style="color:blue;">Ceci est un test HTML !</h1>
        <p>Envoi d'un email en <b>HTML</b> avec une pièce jointe.</p>
    </body>
</html>
"""

text_message = "Ceci est un test."

format_mail = ["plain", "html"]

response = email.send_email(
    to_email="destinataire@gmail.com", # email du destinataire 
    subject="Test Email",
    message=html_message, 
    type_email=str(format_mail[1]), # html => pour envoyer sous format html, plain => sous format text
    list_files=["random.hpp", "libcurl-x64.dll"] # 1 ou plusieur fichier cela fonctionne
)

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

osmia-1.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

osmia-1.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: osmia-1.0.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for osmia-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4a14b9e0cb301974fcf9df22040c8cc84377ddd6ae9006b4c9c982d9f9505adc
MD5 682248ea3003e2713ff067b14b75d6b5
BLAKE2b-256 25fac8873bd82a86e1f00167d14854ad164c6f8a1b3a2b454ed073816c65b160

See more details on using hashes here.

File details

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

File metadata

  • Download URL: osmia-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for osmia-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2db62478cf3f1c7fe8a62e43fe7bae89aa744115d336b25bfe452fde8fabfca
MD5 4a29b6d894dec9f0dc5695f9cd0d7685
BLAKE2b-256 b30515a8c667ecaac17232bb174681644754caa957c566920caa05900b797ca8

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