Metadata-Version: 2.4
Name: mailfeed
Version: 0.1.0
Summary: Reusable library for sending HTML emails with images and attachments
Author-email: Randall Hunt <randall@orangeshovel.com>
License: MIT
Project-URL: Homepage, https://github.com/randallhunt/orangeshovel
Project-URL: Repository, https://github.com/randallhunt/orangeshovel
Keywords: email,html,smtp,newsletter
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: lxml>=4.9.0
Requires-Dist: lxml-html-clean>=0.1.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: flake8>=6.0; extra == "dev"
Requires-Dist: mypy>=1.0; extra == "dev"
Dynamic: license-file

# Mailfeed

A reusable Python library for sending HTML emails with images and attachments.

## Features

- Build HTML emails with embedded images
- Clean and normalize HTML content
- Send emails via SMTP
- Flexible configuration via dependency injection
- Type-safe interfaces

## Installation

```bash
pip install mailfeed
```

For development:
```bash
pip install -e ".[dev]"
```

## Quick Start

```python
from mailfeed import EmailService

# Create email service
email_service = EmailService()

# Build email with images
images = {
    'image1': '/path/to/image1.png',
    'image2': '/path/to/image2.png'
}

msg = email_service.build_html_email(
    from_email='sender@example.com',
    to_email='recipient@example.com',
    subject='Hello from Mailfeed',
    text='Plain text version',
    html='<html><body><h1>Hello</h1><img src="cid:image1"/></body></html>',
    images=images
)

# Send via SMTP
email_service.send_smtp_email(
    sender='sender@example.com',
    recipient='recipient@example.com',
    msg=msg,
    host='smtp.example.com',
    port=587,
    smtp_username='username',
    smtp_password='password'
)
```

## HTML Normalization

```python
from mailfeed import HTMLNormalizer, HTMLConfig

config = HTMLConfig(
    email_image_width=600,
    email_image_height=400,
    email_image_border=0
)

normalizer = HTMLNormalizer(config)
clean_html = normalizer.clean_html(dirty_html)
```

## License

MIT License - see LICENSE file for details.
