Project

lex-smtp

0.0
No release in over 3 years
LEX::SMTP
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

Runtime

 Project Readme

lex-smtp

SMTP email extension for LegionIO. Compose and deliver emails via SMTP from within task chains using Ruby's built-in Net::SMTP.

Installation

gem install lex-smtp

Or add to your Gemfile:

gem 'lex-smtp'

Usage

Send an email by triggering the email.send runner:

{
  "to": "recipient@example.com",
  "from": "sender@example.com",
  "subject": "Hello from Legion",
  "body": "Message body text",
  "address": "smtp.example.com",
  "port": 587
}

Runner

Runner Method Required Parameters
Email send to, from, subject, body

Optional: address (default: localhost), port (default: 25)

Standalone Client

Use lex-smtp as a standalone email client without the full Legion framework:

require 'legion/extensions/smtp/client'

client = Legion::Extensions::Smtp::Client.new(address: 'smtp.example.com', port: 587)
client.send(to: 'user@example.com', from: 'bot@example.com', subject: 'Hello', body: 'World')

Options passed to Client.new become defaults for all sends. You can override per-call via the send keyword arguments.

Requirements

  • Ruby >= 3.4
  • SMTP server
  • LegionIO framework (optional — standalone Client works without it)

License

MIT