                     (throw (IllegalArgumentException. ":subject argument required")))
         cc (if (not (or (nil? cc) (sequential? cc))) [cc] cc)
         bcc (if (not (or (nil? bcc) (sequential? bcc))) [bcc] bcc)]
-    (MailMessage. from to subject text-body html-body reply-to cc bcc attachments)))
+    (record MailMessage
+            :from from :to to :subject subject
+            :text-body text-body :html-body html-body
+            :reply-to reply-to :cc cc :bcc bcc
+            :attachments attachments)))
 
 
 (defn- make-mail-service-message [^MailMessage msg]


(defn send-to-admins [^MailMessage msg]
  (.sendToAdmins (get-mail-service) (make-mail-service-message msg)))

(ns appengine-magic.services.mail
  (:refer-clojure :exclude (send))
  (:use [appengine-magic.utils :only [record]])
  (:import [com.google.appengine.api.mail MailServiceFactory
            MailService$Message MailService$Attachment]))

