Changeset 2785
- Timestamp:
- 03/23/08 16:01:52 (8 months ago)
- Files:
-
- trunk/thirdparty/cl-smtp/cl-smtp.lisp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/thirdparty/cl-smtp/cl-smtp.lisp
r2784 r2785 103 103 lines)) 104 104 105 (defun do-with-smtp-mail (host port from to thunk &keyauthentication ssl local-hostname)105 (defun do-with-smtp-mail (host from to thunk &key port authentication ssl local-hostname) 106 106 (usocket:with-client-socket (socket stream host port) 107 107 (let ((stream (smtp-handshake stream … … 113 113 (finish-smtp-mail stream)))) 114 114 115 (defmacro with-smtp-mail ((stream-var host port from to &key authentication ssllocal-hostname)115 (defmacro with-smtp-mail ((stream-var host from to &key ssl (port (if (eq :tls ssl) 465 25)) authentication local-hostname) 116 116 &body body) 117 117 "Encapsulate a SMTP MAIl conversation. A connection to the SMTP … … 121 121 connected to the remote SMTP server. BODY is expected to write the 122 122 RFC2821 message (headers and body) to STREAM-VAR." 123 `(do-with-smtp-mail ,host , port ,from ,to123 `(do-with-smtp-mail ,host ,from ,to 124 124 (lambda (,stream-var) ,@body) 125 :port ,port 125 126 :authentication ,authentication 126 127 :ssl ,ssl … … 128 129 129 130 (defun send-email (host from to subject message 130 &key (port 25) cc bcc reply-to extra-headers131 &key ssl (port (if (eq :tls ssl) 465 25)) cc bcc reply-to extra-headers 131 132 html-message display-name authentication 132 attachments (buffer-size 256) ssl)133 attachments (buffer-size 256)) 133 134 (send-smtp host from (check-arg to "to") subject (mask-dot message) 134 135 :port port :cc (check-arg cc "cc") :bcc (check-arg bcc "bcc") … … 144 145 :ssl ssl)) 145 146 146 (defun send-smtp (host from to subject message 147 &key (port 25) cc bcc reply-to extra-headers html-message 148 display-name authentication attachments buffer-size ssl 147 (defun send-smtp (host from to subject message 148 &key ssl (port (if (eq :tls ssl) 465 25)) cc bcc 149 reply-to extra-headers html-message display-name 150 authentication attachments buffer-size 149 151 (local-hostname (usocket::get-host-name))) 150 (with-smtp-mail (stream host port from (append to cc bcc) 152 (with-smtp-mail (stream host from (append to cc bcc) 153 :port port 151 154 :authentication authentication 152 155 :ssl ssl … … 306 309 ;; Plain SSL connection 307 310 (convert-connection-to-ssl) 311 (do-ehlo)) 312 ((nil) 308 313 (do-ehlo)))) 309 314 (when authentication
