Function: diary-mail-entries
diary-mail-entries is an autoloaded, interactive and byte-compiled
function defined in diary-lib.el.gz.
Signature
(diary-mail-entries &optional NDAYS)
Documentation
Send a mail message showing diary entries for next NDAYS days.
If no prefix argument is given, NDAYS is set to diary-mail-days.
Mail is sent to the address specified by diary-mail-addr.
Here is an example of a script to call diary-mail-entries,
suitable for regular scheduling using cron (or at). Note that
since emacs -script does not load your init file, you should
ensure that all relevant variables are set.
#!/usr/bin/emacs -script
;; diary-rem.el - run the Emacs diary-reminder
(setq diary-mail-days 3
diary-file "/path/to/diary.file"
calendar-date-style 'european
diary-mail-addr "user@host.name")
(diary-mail-entries)
# diary-rem.el ends here
Probably introduced at or before Emacs version 20.3.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/calendar/diary-lib.el.gz
;;;###autoload
(defun diary-mail-entries (&optional ndays)
"Send a mail message showing diary entries for next NDAYS days.
If no prefix argument is given, NDAYS is set to `diary-mail-days'.
Mail is sent to the address specified by `diary-mail-addr'.
Here is an example of a script to call `diary-mail-entries',
suitable for regular scheduling using cron (or at). Note that
since `emacs -script' does not load your init file, you should
ensure that all relevant variables are set.
#!/usr/bin/emacs -script
;; diary-rem.el - run the Emacs diary-reminder
\(setq diary-mail-days 3
diary-file \"/path/to/diary.file\"
calendar-date-style \\='european
diary-mail-addr \"user@host.name\")
\(diary-mail-entries)
# diary-rem.el ends here"
(interactive "P")
(if (string-equal diary-mail-addr "")
(user-error "You must set `diary-mail-addr' to use this command")
(let ((diary-display-function #'diary-fancy-display))
(diary-list-entries (calendar-current-date) (or ndays diary-mail-days)))
(compose-mail diary-mail-addr
(concat "Diary entries generated "
(calendar-date-string (calendar-current-date))))
(insert
(if (get-buffer diary-fancy-buffer)
(with-current-buffer diary-fancy-buffer (buffer-string))
"No entries found"))
(call-interactively (get mail-user-agent 'sendfunc))))