[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mailer strictly from lisp
Date: Tue, 4 Sep 90 12:20:07 EDT
From: email@example.com (Kristina Fayyad)
System: MacIvory, Genera 8.0
I am trying to use the Mailer strictly from lisp. So far I can
execute the function mailer:mail with to, subject, and message-body
e.g. (mailer:mail "me@somewhere"
"this is the body of the message"
nil nil nil nil
"this is the subject of the message")
However, this brings up the Mailer (zwei) editor with the message
composed as desired. To send the message it is necessary to press the
This function is the "Give me a mail editor" function. You probably want
to use ZWEI:SEND-MESSAGE-STRING:
"This is the body of the message"
:subject "This is the subject of the message")
Be prepared to catch errors, of course. These might have the flavor
ZWEI:BARF mixed in.
[The way I found this function was to use the Zmacs command m-X Edit CP Command,
asking for the source for the CP command "Send Mail", which I knew had the
behaviour you wanted.]
There is, of course, much lower-lying software for sending mail which
doesn't use the Zmail interface. For example, here is a schematic of an
automatic mail-sender I wrote some time back:
(defun send-mail-to (&key recipients subject text
(message-id (zwei:generate-standard-message-id date)))
(loop named mail-sent
for mail-service in (zwei:find-sorted-mail-services)
(mailer:with-mailer (mailer mail-service)
(send mailer :start-message `(:user ,si:*user*))
(loop for recipient in (zwei:parse-addresses recipients) do
(send mailer :verify-recipient recipient))
(message-stream (format nil "Date: ~\\TIME\\~%~
date subject si:*user*
(send mailer :receive-message nil message-stream)))
(:no-error (return-from mail-sent)))))
Now you can say
(send-mail-to :recipients "me@somewhere"
:subject "This is the subject line"
:text "This is the text body")
and it will do the right thing.