I did try adding type hints and the doto style initially although my
type is [InternetAddress], not string.

On May 27, 8:09 am, Sean Devlin <francoisdev...@gmail.com> wrote:
> Have you tried adding type hints?  Sometimes reflection confuses the
> JVM with interop, especially when there is ambiguity in the type.
> This is the case for setRecipients.
>
> Oh, you'll want to use a doto form as well in plain-message, such as
> this:
>
> (defn plain-message [{:keys [from to cc bcc subject body]}]
>   (doto (MimeMessage. (get-default-session))
>     (setRecipients Message$RecipientType/TO ^String to)
>     (setRecipients Message$RecipientType/CC ^String cc)
>     (setRecipients Message$RecipientType/BCC ^String bcc)
>     (setFrom from)
>     (setSubject subject)
>     (setContent body "text/plain")))
>
> Hope that helps,
> Sean
>
> On May 27, 10:45 am, Matthew Elder <sse...@gmail.com> wrote:
>
> > Clojure Users:
>
> > Could anyone please help me with the problem I am having here?
>
> >      http://clojure.pastebin.com/yR6yPQha
>
> > Essentially I am running into a situation where the interop operator
> > '.' doesn't work for some instance methods of
> > javax.mail.internet.MimeMessage.
>
> > I have tried various different constructs and methods but I always get
> > the same exception:
>
> >      No matching method found: setRecipients  for class
> > javax.mail.internet.MimeMessage
>
> > - I have tried using clojure 1.1/contrib 1.1 and also now clojure 1.2
> > snapshot/contrib 1.2 snapshot
> > - version: Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> > Windows XP SP3
> > - I am retrieving jars via lein (project.clj included in pastebin)
>
> > Any help is appreciated!
>
> > Thanks,
> > Matthew Elder
> > Novice Clojure Programmer

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to