Common Lisp Package: CL-SENDMAIL

README:

FUNCTION

Private

BUILD-ATTACHMENTS (MAIL-OUTPUT-STREAM)

Converts MAIL-OUTPUT-STREAM to a multipart MIME email. Converts all attachments to MIME parts of an attachment disposition and adds them to the MIME email. Converts the content of the stream to a MIME attachment according to the original MIME type of the stream and encodes it appropriately.

BUILD-XHTML-EMAIL (MAIL-OUTPUT-STREAM)

The CONTENT slot of MAIL-OUTPUT-STREAM is expected to be an XML structure comparable to what XMLS would output after parsing XML. The content is parsed for any images in file locations which are loaded, encoded and turned into MIME attachments. The XML is modified to have the image source point to the content ID of the new attachment. The XML itself is converted into a text equivalent which is put in a text/plain MIME part while the XML itself is output as XHTML in a text/html MIME part. Note: the process of attaching images is destructive to the XML structure. If you want to keep your XML structure intact make a copy first.

GET-PROTOCOL (URL &OPTIONAL (STRING ))

Obtains the protocol part of URL

READ-FILE (PATHNAME)

Reads a file and returns an unsigned byte array holding the contents

RETRIEVE-FILE (URL)

Reads the file located at URL and converts it to base64

SEND-EMAIL (MAIL-OUTPUT-STREAM)

Handles the actual sending of the email via the sendmail program

URL-FILENAME (URL &OPTIONAL (STRING ))

Obtains the filename part of URL

URL-PATH (URL &OPTIONAL PATH-START)

Obtains the path part of URL

Undocumented

SPLIT-STRING (SPLITTER STRING SEGMENT-SIZE)

MACRO

Public

WITH-EMAIL ((STREAM TO &KEY CC BCC SUBJECT FROM REPLY-TO (TYPE text) (SUBTYPE plain) ATTACHMENTS OTHER-HEADERS) &BODY BODY)

Binds STREAM to a MAIL-OUTPUT-STREAM created according to the other arguments then executes BODY within that context. Automatically closes the stream and sends the email upon completion.

Private

Undocumented

DESCEND

GENERIC-FUNCTION

Private

Undocumented

ERROR-CODE (CONDITION)

SETFERROR-CODE (NEW-VALUE CONDITION)

SLOT-ACCESSOR

Public

Undocumented

ATTACHMENTS (OBJECT)

SETFATTACHMENTS (NEW-VALUE OBJECT)

BCC (OBJECT)

SETFBCC (NEW-VALUE OBJECT)

CC (OBJECT)

SETFCC (NEW-VALUE OBJECT)

CONTENT-TYPE (OBJECT)

OTHER-HEADERS (OBJECT)

SETFOTHER-HEADERS (NEW-VALUE OBJECT)

SUBJECT (OBJECT)

SETFSUBJECT (NEW-VALUE OBJECT)

TO (OBJECT)

SETFTO (NEW-VALUE OBJECT)

Private

Undocumented

FROM (OBJECT)

SETFFROM (NEW-VALUE OBJECT)

MAIL-OUTPUT-STREAM-STREAM (OBJECT)

SETFMAIL-OUTPUT-STREAM-STREAM (NEW-VALUE OBJECT)

REPLY-TO (OBJECT)

SETFREPLY-TO (NEW-VALUE OBJECT)

STRING-STRM (OBJECT)

SETFSTRING-STRM (NEW-VALUE OBJECT)

VARIABLE

Private

*SENDMAIL*

The location of the sendmail program

Undocumented

*XHTML-EMAIL-PARSER*

CLASS

Public

MAIL-OUTPUT-STREAM

The basic MAIL-OUTPUT-STREAM.

Private

MAIL-OUTPUT-STREAM-MIXIN

A mixin for the mail-output-streams. Not intended to be used directly. Use the other streams

MULTIPART-MAIL-OUTPUT-STREAM

A MAIL-OUTPUT-STREAM intended for multipart MIME emails

TEXT-MAIL-OUTPUT-STREAM

A MAIL-OUTPUT-STREAM intended for text-only emails

CONDITION

Public

Undocumented

MAILER-PROGRAM-ERROR