Today I want to give an usage example of cl-smtp. It's a good, maintained library, with a good README but no proper documentation, nor a ready-to-copy-paste usage example.
cl-smtp
Here it is:
(cl-smtp:send-email "mail.server.org" "from@mail.org" "to@mailz.org" "subject" "just a test message from Emacs/Slime."
:port 587 :ssl :starttls
:authentication (list "from@mail.org" "password"))
;; => ("2.0.0 Bye")
The lambda list is:
(cl-smtp:send-email host from to subject message :ssl ssl
:port port
:cc cc
:bcc bcc
:reply-to reply-to
:extra-headers extra-headers
:html-message html-message
:display-name display-name
:authentication authentication
:attachments attachments
:buffer-size buffer-size
:envelope-sender envelope-sender
:external-format external-format
:local-hostname local-hostname
:message-id message-id)
This code snippet allows to send an email from Common Lisp with an existing email account: be it Gmail or any other regular email provider, as long as you know its SMTP address or IP, and your account ID and password.
Postmaster
Eudoxia's postmaster is a wrapper around cl-smtp and mel-base. It adds object-orientation to create and use servers as first-class objects, as well as some defaults.
It uses cl-smtp to send emails, and mel-base to manage pop3/IMAP folders.
The repository is now read-only, let's maintain it together on https://github.com/lisp-maintainers/ if you are so inclined.
Sendgrid, Mailgun
If you want to rely on a third-party email provider, you can create an account there and these libraries have you covered:
- sendgrid - send emails with Sendgrid's API.
- mailgun - A thin wrapper to post HTML emails through mailgun.com.
Reading mail: trivial-imap
trivial-imap wants to make mel-base or post-office (a fork of Franz's cl-imap) easier to use. I didn't try any of them.
It even has the possibility to search for emails.
Sending (and possibility reading) emails in Common Lisp isn't trendy but just works© ;)
for any news please check the list of https://github.com/CodyReichert/awesome-cl/