BruceBlog

Sunday, November 29, 2009

Emacs and elisp - sending mail

Here's an elisp function that takes the recipient's address, the subject, and
the body of the message as parameters. There's a sample call below it.

;; This function sends a mail message
(defun my-message-mail-fn (addr subj body)
"Send a message in an email"
(interactive)
(let ((orig-buffer (current-buffer)))
(message-mail addr subj)
(message-goto-body)
(insert body)
(message-send-and-exit)))

;; Here's how to test it (or call it):

(my-message-mail-fn "yahoo@yahoo.com" "trial subject" "here's the body")


0 Comments:

Post a Comment

<< Home