smtp

Crystal SMTP Library

Crystal SMTP Library

Docs

A lightweight SMTP client/server library for Crystal.
This library aims to provide simple and reliable SMTP functionality with minimal dependencies.

Status

🏗️ Work in Progress

  • ✅ SMTP Client - Complete and working
  • 🚧 SMTP Server - Planned, not yet implemented

Installation

  1. Add the dependency to your shard.yml:
dependencies:
  smtp:
    github: alefunion/smtp
  1. Run shards install

Usage

require "smtp"

# Initialize client
client = SMTP::Client.new("email-smtp.us-east-1.amazonaws.com")

begin
  # Authenticate
  client.authenticate("your_username", "your_password")

  # Send email
  client.send_email(
    from: "sender@yourdomain.com",
    to: "recipient@example.com",
    subject: "Test Email",
    body: "Hello from Crystal!"
  )
ensure
  client.close
end

Features

SMTP Client

  • TLS support (STARTTLS)
  • Authentication (LOGIN method)
  • Basic email sending functionality
  • Proper SMTP response handling
  • Error handling with custom SMTP::Error class

SMTP Server (Coming Soon)

  • Basic SMTP server implementation
  • TLS support
  • Authentication handlers
  • Message processing hooks
  • Custom routing rules
Repository

smtp

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • 7 months ago
  • January 29, 2025
License

MIT License

Links
Synced at

Sat, 20 Sep 2025 21:03:02 GMT

Languages