Skip to content

eudoxia0/postmaster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Postmaster - Email for humans

Postmaster is a simple, easy to use SMTP/IMAP library with an API inspired by NodeMailer.

Usage

Services

Postmaster maintains a list of common and well-known services, so you don't have to worry about hosts and ports, and can just send email to addresses.

(in-package :postmaster.services)

;; You can find services by name
(find-service-by-name "gmail")

;; ... Or by domain name
(find-service-by-domain "gmail.com")

;; Failing that, you can define your own
(defparameter *service*
  (make-instance '<service>
                 :name "GMail"
                 :domains (list "gmail.com" "googlemail.com")
                 :smtp-server (make-instance '<smtp-server>
                                             :host "smtp.gmail.com"
                                             :ssl :tls)))

Class defaults (SSL, ports) are safe and sane.

Accounts

Once you have a service, you log in:

(in-package :postmaster.services)

(defparameter *account*
  (make-instance '<account>
                 :service *service*
                 :username "[email protected]"
                 :password "A really long, safe dictionary password. Right?"))

Sending Email

(defparameter *email*
  (make-instance 'postmaster.email:<email>
                 :from "[email protected]"
                 :to "[email protected]"
                 :subject "Why you should rewrite all your startup's code in CL"
                 :body "Paul Graham. Speed. Macros. CLOS. Done"))

(postmaster.smtp:send *account* *email*)

Extensions

This library provides a mock Email service that stores all messages it gets in an internal store. Accounts can be registered to the service and the stored emails inspected. This is useful for testing a Postmaster-based application.

License

Copyright (c) 2014 Fernando Borretti ([email protected])

Licensed under the MIT License.

About

Email for humans

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published