Metadata-Version: 2.4
Name: osmia
Version: 1.1.0
Summary: An ultra-simple and SOLID Python library for sending emails with attachments and HTML or plain text support.
Home-page: https://github.com/Tina-1300/Osmia
Author: Tina
Author-email: tina.xytrfgthuji1348@gmail.com
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Communications :: Email
Requires-Python: >=3.13.0
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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
- sending email to a recipient email list

---

## 🚀 Installation

```bash
git clone https://github.com/Tina-1300/Osmia.git
```
or 
```bash 
pip install osmia
```

example usage of library :

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

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

# Creation of the email
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"]

files_listes = ["random.hpp", "libcurl-x64.dll"]


# sends the same email to all emails in the to_email list
responses = email.send_email(
    to_email=["destinatere@gmail.com", "destinatere2@gmail.com", "destinatere3@gmail.com"], # recipient email or make a recipient email list
    subject="Test Email html format",
    message=html_message, 
    type_email=str(format_mail[1]), # html => to send in html format, plain => in text format
    list_files=files_listes # 1 or more files it works
)

# we can keep this syntax
response = email.send_email(
    to_email="destinatere@gmail.com", # recipient email or make a recipient email list
    subject="Test Email text format",
    message=text_message, 
    type_email=str(format_mail[0]), # html => to send in html format, plain => in text format
    list_files=files_listes # 1 or more files it works
)

# Please note that sending large files does not work.
```
