MayDaniel/clj-mail

587 "smtp" false

supercentenarian opened this issue · 0 comments

(defn properties [username host port ssl](let [properties %28Properties.%29]
%28doto properties
%28.put "mail.smtp.host" host)
(.put "mail.smtp.user" username)
(.put "mail.smtp.port" port)
(.put "mail.smtp.socketFactory.port" port)
(.put "mail.smtp.auth" "true")
(.put "mail.smtp.starttls.enable" "true"))
(when ssl
(doto properties ..

I can't use 465 cuz it's blocked. I added this line (.put "mail.smtp.starttls.enable" "true")
and it works for this example:
(with-session "blah@gmail.com" "secret" "smtp.gmail.com" 587 "smtp" false
(send-email (text-email ["blah@gmail.com"] "subject" "body")))

I don't know why, all I know is that's how I got the code to work. Thanks for your time.