Code Monkey home page Code Monkey logo

send-mail's Introduction

#README

Welcome to the send-mail Clojure library wiki.

Introduction

send-mail is a simple Clojure library for sending emails, written in pure Clojure, and licensed under the Eclipse Public License. The original use case was for sending emails from a noir web app hosted on Heroku. Inspired by this tutorial on Heroku for sending mail from rails apps, and the referenced article on sending email using gmail.

Features

  • Minimalist
  • No underlying dependencies
  • Gmail support
  • STARTTLS support via secure sockets

Getting Started

Setup

You'll need a gmail account.

Usage

  1. 'use' or 'require' send-mail in your namespace.

(ns your-namespace (:use send-mail)...)

  1. Call one of the send-mail functions (multiple recipients can be defined in a collection of strings):

(send-mail "from-email" "to-email" "subject" "message" "from-gmail-passwd")

(send-mail "from-email" "to-email" "subject" "message" "gmail-acct" "gmail-password")

(send-mail "from-email" "to-email" "subject" "message" "host" "port" "server-acct" "server-port" timeout-in-millis)

Examples:

(send-mail "[email protected]" "destination@localhost" "Website Inquiry" (join \newline (map (fn [[k v]] (format "%s = %s" (name k) v) ) contact)) "s3cr3t")

(send-mail "[email protected]" ["dest1@localhost" "dest2@localhost"] "Website Inquiry" (join \newline (map (fn [[k v]] (format "%s = %s" (name k) v) ) contact)) "s3cr3t")

Known Issues & Limitations

The library has been designed for use with gmail initially. It may or may not work with other smtp servers. It is not a full implementation of SMTP, although it uses SMTP.

  • Assumes the smtp server supports STARTTLS.
  • Assumes the smtp server supports AUTH LOGIN.
  • Gmail limits the number of emails to 500 per day (according to the article referenced in the introduction).
  • There is little to no error handling.
  • The SMTP defines timeouts in terms of minutes; it's important to set a reasonable timeout or use the default. The function without a timeout defaults to 1 minute.
  • Attachments aren't supported.
  • Aliases aren't supported.
  • Logs with printlns.
  • Uses a Java String to represent the password. Using a String is considered less secure than using a char array due to jvm internals.

Alternatives

send-mail's People

Contributors

dbleyl avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.