Created
August 18, 2010 03:11
-
-
Save tnoborio/533238 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns mail | |
(import [org.apache.commons.mail | |
SimpleEmail])) | |
(defn sendmail [& {:keys [from to subject content charset host], | |
:or {charset "iso-2022-jp"}}] | |
(doto (SimpleEmail.) | |
(.setHostName host) | |
(.setCharset charset) | |
(.setContent content (str "text/plain; charset=" charset)) | |
(.setSubject subject) | |
(.addTo to) | |
(.setFrom from) | |
(.send))) | |
; (sendmail :from "t.noborio@gmail.com" :to "t.noborio@gmail.com" :subject "件名" :content "ほげ" :host "localhost") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment