Lightweight C library for HTML5 websockets
SMTP related functions

SMTP related functions

These apis let you communicate with a local SMTP server to send email from lws. It handles all the SMTP sequencing and protocol actions.

Your system should have postfix, sendmail or another MTA listening on port 25 and able to send email using the "mail" commandline app. Usually distro MTAs are configured for this by default.

It runs via its own libuv events if initialized (which requires giving it a libuv loop to attach to).

It operates using three callbacks, on_next() queries if there is a new email to send, on_get_body() asks for the body of the email, and on_sent() is called after the email is successfully sent.

To use it

When you have at least one email to send, call lws_email_check() to schedule starting to send it.