Home

Awesome

pod-tzzh-mail

A pod to send emails with babashka

It's relying entirely on https://github.com/jordan-wright/email and so supports most of its features

Usage

(require '[babashka.pods :as pods])
(pods/load-pod 'tzzh/mail "0.0.2")
(require '[pod.tzzh.mail :as m])

(m/send-mail {:host "smtp.gmail.com"
              :port 587
              :username "kylian.mbappe@gmail.com"
              :password "kylian123"
              :subject "Subject of the email"
              :from "kylian.mbappe@gmail.com"
              :to ["somebody@somehwere.com"]
              :cc ["somebodyelse@somehwere.com"]
              :text "aaa" ;; for text body
              :html "<b> kajfhajkfhakjs </b>" ;; for html body
              :attachments ["./do-everything.clj"] ;; paths to the files to attch
              })

To use with gmail you need to allow less secure apps

Debugging

For debugging set the environment variable POD_TZZH_MAIL_DEBUG=true and the logs will show in stderr.