Skip to content
/ postmail Public
forked from ironcamel/postmail

A simple REST based service for sending email. Similar to Amazon's Simple Email Service.

Notifications You must be signed in to change notification settings

mago0/postmail

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Postmail is a simple REST based service for sending email. Similar to Amazon's Simple Email Service. It is asynchronous and highly scalable. Emails are placed on a job queue and multiple workers process them independently.

Installation

First install dependencies:

sudo cpanm Email::Sender Email::Sender::Transport::SMTP::TLS Email::Simple Dancer::Plugin::Stomp JSON Starman Try::Tiny YAML

Usage

Edit the config.yml file to configure your Stomp message broker and SMTP server settings.

Start the server:

plackup -s Starman ./bin/app.pl

Start the worker:

./bin/worker.pl

Send an email:

lwp-request -m POST http://localhost:5000/email <<EOD
{
    "from":    "bob@foo.com",
    "to":      "joe@foo.com",
    "subject": "hi from postmail",
    "body":    "bye"
}
EOD

Send an email to multiple recipients:

lwp-request -m POST http://localhost:5000/email <<EOD
{
    "from":    "bob@foo.com",
    "to":      ["joe@foo.com", "bazz@foo.com"],
    "subject": "hi from postmail",
    "body":    "bye"
}
EOD

Stomp Message Broker

It is very easy to get a Stomp message broker up and running:

sudo cpanm POE::Component::MessageQueue
sudo mq.pl

Running sudo mq.pl will start a broker on localhost listening on port 61613. The default stomp settings in config.yml will then just work.

About

A simple REST based service for sending email. Similar to Amazon's Simple Email Service.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Perl 77.9%
  • CSS 22.1%