Skip to main content

🛠️ Project Scaffold for SetMail


📁 Folder structure:

setmail/
├── __init__.py
setup.py
README.md

📄 setup.py

from setuptools import setup

setup(
    name='SetMail',
    version='0.1',
    author='Your Name',
    author_email='your@email.com',
    description='Minimalist email sending for Python — just import and send',
    long_description=open("README.md").read(),
    long_description_content_type='text/markdown',
    url='https://pypi.org/project/SetMail/',
    packages=['setmail'],
    classifiers=[
        'Programming Language :: Python :: 3',
        'License :: OSI Approved :: MIT License',
    ],
    python_requires='>=3.7',
)

📄 setmail/__init__.py (placeholder logic)

import smtplib
from email.mime.text import MIMEText
import os

def send(to, subject, body, sender=None, smtp_server=None, password=None):
    sender = sender or os.getenv("SETMAIL_FROM")
    smtp_server = smtp_server or os.getenv("SETMAIL_SMTP")
    password = password or os.getenv("SETMAIL_PASS")

    if not all([sender, smtp_server, password]):
        raise ValueError("Missing SMTP configuration.")

    msg = MIMEText(body, "plain")
    msg["Subject"] = subject
    msg["From"] = sender
    msg["To"] = to

    host, port = smtp_server.split(":")
    with smtplib.SMTP_SSL(host, int(port)) as server:
        server.login(sender, password)
        server.sendmail(sender, [to], msg.as_string())

📄 README.md

# SetMail

> The simplest way to send email in Python — no setup, just import and go.

[![PyPI version](https://img.shields.io/pypi/v/setmail.svg)](https://pypi.org/project/SetMail/)
[![License](https://img.shields.io/pypi/l/setmail.svg)](https://opensource.org/licenses/MIT)
[![Python](https://img.shields.io/pypi/pyversions/setmail.svg)](https://python.org)

---

### 💡 What is SetMail?

SetMail is a zero-config SMTP mail sender designed for small Python projects.  
Use environment variables or pass values manually — and you're sending in seconds.

---

### 📦 Install

```bash
pip install setmail

🚀 Example

import setmail

setmail.send(
    to="hello@example.com",
    subject="Test Email",
    body="This was sent using SetMail!"
)

⚙️ Environment Variables

You can configure SetMail globally with these:

export SETMAIL_FROM="you@example.com"
export SETMAIL_SMTP="smtp.example.com:465"
export SETMAIL_PASS="yourpassword"

Then just call send() with to, subject, and body.


🔐 Security Tip

Don't hardcode passwords in code — use .env, CI secrets, or vault systems.


📄 License

MIT. Lightweight and open to contributions.

Release files for SetMail 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SetMail 0.1
File Size Uploaded
SetMail-0.1.tar.gz 2.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for SetMail 0.1
File Interpreter ABI Platform
SetMail-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 4.7 kB

Release files / SetMail-0.1.tar.gz

Download URL SetMail-0.1.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d0e4059e799cd00ade23066f753ceef1c33aeff3288b3d432330bbab3f01ffcd
BLAKE2b-256 checksum
How to use checksums
26712961b3a1b08b86d8be84cc89e194120efa1fddffc194505617bb90110718
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / SetMail-0.1-py3-none-any.whl

Download URL SetMail-0.1-py3-none-any.whl
Size 2.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdc65bb5572314bef88437226e8afe2e554b85f45e734dbfaf877abe5672e45a
BLAKE2b-256 checksum
How to use checksums
51b4c2f257464a0e453f03111c4d472c796afda4c2e7ec58a0a343c10c7c1ca7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page