README 4.22 KB
Newer Older
Jan Idzikowski's avatar
Jan Idzikowski committed
1
2

CL-SMTP is a simple lisp smtp client. 
3
It works in ACL, SBCL, CMUCL, OPENMCL, LISPWORKS, CLISP and ECL.
Jan Idzikowski's avatar
Jan Idzikowski committed
4

5
6
7
new with support for send attachments, thanks Brian Sorg for the implementation

with authentication support for PLAIN and LOGIN authentication method
8

9
10
and ssl support with cl+ssl package

11
used cl-base64 and usocket packages (cl-base64 isn't a requirement on ACL)
12

Jan Idzikowski's avatar
Jan Idzikowski committed
13
14
15
16
17
18
See INSTALL for prerequisites and build details.

To use cl-smtp:

(asdf:operate 'asdf:load-op 'cl-smtp)

19
20
------------------------------------------------

Jan Idzikowski's avatar
Jan Idzikowski committed
21
(cl-smtp:send-email host from to subject message
22
                    &key (port 25) cc bcc reply-to extra-headers html-message 
23
                    authentication attachments (buffer-size 256) ssl)
24
Send email.
Jan Idzikowski's avatar
Jan Idzikowski committed
25

26
27
28
Returns nil or error with message

 arguments:
Jan Idzikowski's avatar
Jan Idzikowski committed
29
30
  - host (String)                  : hostname or ip-adress of the smtpserver
  - from (String)                  : email adress 
Jan Idzikowski's avatar
Jan Idzikowski committed
31
  - to (String or List of Strings) : email adress 
Jan Idzikowski's avatar
Jan Idzikowski committed
32
33
  - subject (String)               : subject text
  - message (String)               : message body
34
 keywords:
Jan Idzikowski's avatar
Jan Idzikowski committed
35
36
  - cc (String or List of Strings) : email adress carbon copy
  - bcc (String or List of Strings): email adress blind carbon copy
Jan Idzikowski's avatar
Jan Idzikowski committed
37
  - reply-to (String)              : email adress
38
  - displayname (String)           : displayname of the sender
Jan Idzikowski's avatar
Jan Idzikowski committed
39
  - extra-headers (List)           : extra headers as alist
40
  - html-message (String)          : message body formatted with HTML tags
Jan Idzikowski's avatar
Jan Idzikowski committed
41
42
  - authentication (List)          : list with 2 or elements
                                     ([:method] "username" "password")
43
                                     method is a keyword :plain or :login
Jan Idzikowski's avatar
Jan Idzikowski committed
44
45
                                     If the method is not specified, the
                                     proper method is determined automatically.
46
47
  - attachments (Attachment Instance or String or Pathname: attachments to send
                List of Attachment/String/Pathnames)
48
  - buffer-size (Number default 256): is no longer used, will remove in the future
Jan Idzikowski's avatar
Jan Idzikowski committed
49
50
  - ssl (or t :starttls :tls)       : if t or :STARTTLS: use the STARTTLS functionality
                                      if :TLS: use TLS directly
51
  - external-format                 : symbol, default :utf-8
Jan Idzikowski's avatar
Jan Idzikowski committed
52

53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
------------------------------------------------

(cl-smtp:rfc2045-q-encode-string str &key (external-format :utf8))

Decodes a string to an quoted-printable string.

Returns quoted-printable string

 arguments:
  - str                             : the string to encode
 keywords:
  - external-format                 : symbol, default :utf-8

------------------------------------------------

(cl-smtp:rfc2231-encode-string str &key (external-format :utf8))

Decodes a string to an rfc2231 encode string.

Returns  rfc2231 encode string

 arguments:
  - str                             : the string to encode
 keywords:
  - external-format                 : symbol, default :utf-8

------------------------------------------------
CLASS
cl-smtp:attachment 

 - accessor: attachment-name          : string 
 - accessor: attachment-data-pathname : pathname
 - accessor: attachment-mime-type     : string (mime-type)

It is now possible to send a file under a different name.
See cl-smtp:make-attachment.
------------------------------------------------

(cl-smtp:make-attachment data-pathname
			 &key (name (file-namestring data-pathname))
			      (mime-type (lookup-mime-type name)))

Create a instance of cl-smtp:attachment.

Returns cl-smtp:attachment

 arguments:
  - data-pathname                     : pathname
 keywords:
  - name                              : string, 
                                        default (file-namestring data-pathname)
  - mime-type                         : string,
                                        default (lookup-mime-type name)
------------------------------------------------
Jan Idzikowski's avatar
Jan Idzikowski committed
107
108
109
110
111
112
113
114
115
116
117

For debug output set the parameter *debug* to t (default nil)
(setf cl-smtp::*debug* t)

CL-SMTP set automaticly the Date header and the X-Mailer header.
X-Mailer: cl-smtp ((lisp-implementation-type) (lisp-implementation-version))

You can change this with setting the parameter *x-mailer*
(setf cl-smtp::*x-mailer* "my x-mailer string)

If you find bugs or want to send patches for enhancements, by email to
118
Jan Idzikowski <jidzikowski@common-lisp.net>