Paste number 77461: sending an email via bknr cl-smtp

Index of paste annotations: 1

Paste number 77461: sending an email via bknr cl-smtp
Pasted by: bobbysmith007
When:10 months, 2 weeks ago
Share:Tweet this! | http://paste.lisp.org/+1NRP
Channel:None
Paste contents:
Raw Source | XML | Display As
;; A simplified version of the function we use to send a client an email
(defmethod send-client-email ((client adwolf-db:clients) subject body &key
			      attachments (to (adwolf-db:emailname client))
			      (from +from-address+) (server +mail-server+)
			      (is-html-p nil))
  (let* ((type (if is-html-p "html" "plain"))
	 (cl-smtp::*content-type* #?"text/${type}; charset=\"UTF8\""))
    (cl-smtp:send-email
     server
     from
     (email-list-from-string to)
     subject
     body
     :attachments attachments))

Annotations for this paste:

Annotation number 1: Example of function and call
Pasted by: bobbysmith007
When:10 months, 2 weeks ago
Share:Tweet this! | http://paste.lisp.org/+1NRP/1
Paste contents:
Raw Source | Display As
;; A simplified version of the function we use to send a client an email
(defun send-email (subject body to &key
			      attachments 
			      (from +from-address+) (server +mail-server+)
			      (is-html-p nil))
  (let* ((type (if is-html-p "html" "plain"))
	 (cl-smtp::*content-type* #?"text/${type}; charset=\"UTF8\""))
    (cl-smtp:send-email
     server
     from
     (email-list-from-string to)
     subject
     body
     :attachments attachments)))

(send-email "test without patch" "<html><body><h2>test</h2></body></html>" "russ@acceleration.net" :attachments (list "mathpuzzel.pdf") :is-html-p T)

Colorize as:
Show Line Numbers
Index of paste annotations: 1

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.