       (add-recipient msg rtype addr)))
   msg)
 
+(defn set-from [msg from]
+  (.setFrom (get-message msg) (InternetAddress. from)))
+
 (defn set-subject [msg subj]
   (.setSubject (get-message msg) subj))
 

  (.getSentDate (get-message msg)))

(defn make-message [attrs]
  (let [{:keys [to cc bcc date subject body]} attrs
        msg (merge attrs {:MimeMessage (MimeMessage. (Session/getInstance (java.util.Properties.)))})]
    (add-recipients msg Message$RecipientType/TO to)
    (add-recipients msg Message$RecipientType/CC cc)
    (add-recipients msg Message$RecipientType/BCC bcc)
    (set-subject msg subject)
    (set-body msg body)
    (set-date msg date)


(deftest all
  (let [date (make-date "yyyy-MM-dd" "2009-01-01")
        msg (make-message {:host "smtp.comcast.net"
                           :from "fee@bar.dom"
                           :to "Foo Bar <foo@bar.dom>"
                           :cc ["baz@bar.dom" "quux@bar.dom"]
                           :date date
                           :subject "Test"
