Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programatically send an email from an elisp function

Tags:

emacs

elisp

I need to automatically send an email from within an elisp function. Hypothetically, I would like a single function which I can pass in the to, from, subject, body, and possibly other headers. Does such a function exist? If not how could it be implemented?

like image 844
Mark Roddy Avatar asked Oct 27 '10 19:10

Mark Roddy


1 Answers

This snippet will send a mail in Emacs:

(progn
    (mail) 
    (mail-to) (insert "[email protected]")
    (mail-subject) (insert "the subject")
    (mail-text) (insert "body of mail")
    (mail-send))

Hope this helps.

like image 59
pokita Avatar answered Sep 22 '22 17:09

pokita