Skip to main content

Minimalist email sending for Python — just import and send

Project description

🛠️ 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.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

SetMail-0.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

SetMail-0.1-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file SetMail-0.1.tar.gz.

File metadata

  • Download URL: SetMail-0.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for SetMail-0.1.tar.gz
Algorithm Hash digest
SHA256 d0e4059e799cd00ade23066f753ceef1c33aeff3288b3d432330bbab3f01ffcd
MD5 01fde002adcc6d3b8939255f25921191
BLAKE2b-256 26712961b3a1b08b86d8be84cc89e194120efa1fddffc194505617bb90110718

See more details on using hashes here.

File details

Details for the file SetMail-0.1-py3-none-any.whl.

File metadata

  • Download URL: SetMail-0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for SetMail-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fdc65bb5572314bef88437226e8afe2e554b85f45e734dbfaf877abe5672e45a
MD5 b9bcbbe1376f71bc0b772512ccd14e45
BLAKE2b-256 51b4c2f257464a0e453f03111c4d472c796afda4c2e7ec58a0a343c10c7c1ca7

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