Function: mh-compose-and-send-mail

mh-compose-and-send-mail is a byte-compiled function defined in mh-comp.el.gz.

Signature

(mh-compose-and-send-mail DRAFT SEND-ARGS SENT-FROM-FOLDER SENT-FROM-MSG TO SUBJECT CC ANNOTATE-CHAR ANNOTATE-FIELD CONFIG)

Documentation

Edit and compose a draft message in buffer DRAFT and send or save it.

SEND-ARGS is the argument passed to the send command. SENT-FROM-FOLDER is buffer containing scan listing of current folder, or nil if none exists. SENT-FROM-MSG is the message number or sequence name or nil. The TO, SUBJECT, and CC fields are passed to the mh-compose-letter-function. If ANNOTATE-CHAR is non-null, it is used to notate the scan listing of the message. In that case, the ANNOTATE-FIELD is used to build a string for mh-annotate-msg. CONFIG is the window configuration to restore after sending the letter.

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-comp.el.gz
(defun mh-compose-and-send-mail (draft send-args
                                       sent-from-folder sent-from-msg
                                       to subject cc
                                       annotate-char annotate-field
                                       config)
  "Edit and compose a draft message in buffer DRAFT and send or save it.
SEND-ARGS is the argument passed to the send command.
SENT-FROM-FOLDER is buffer containing scan listing of current folder,
or nil if none exists.
SENT-FROM-MSG is the message number or sequence name or nil.
The TO, SUBJECT, and CC fields are passed to the
`mh-compose-letter-function'.
If ANNOTATE-CHAR is non-null, it is used to notate the scan listing of
the message. In that case, the ANNOTATE-FIELD is used to build a
string for `mh-annotate-msg'.
CONFIG is the window configuration to restore after sending the
letter."
  (pop-to-buffer draft)
  (mh-letter-mode)

  ;; Insert identity.
  (mh-insert-identity mh-identity-default t)
  (mh-identity-make-menu)

  ;; Cleanup possibly RFC2047 encoded subject header
  (mh-decode-message-subject)

  ;; Insert extra fields.
  (mh-insert-x-mailer)
  (mh-insert-x-face)

  (mh-letter-hide-all-skipped-fields)

  (setq mh-sent-from-folder sent-from-folder)
  (setq mh-sent-from-msg sent-from-msg)
  (setq mh-send-args send-args)
  (setq mh-annotate-char annotate-char)
  (setq mh-annotate-field annotate-field)
  (setq mh-previous-window-config config)
  (setq mode-line-buffer-identification (list "    {%b}"))
  (mh-logo-display)
  (add-hook 'kill-buffer-hook #'mh-tidy-draft-buffer nil t)
  (run-hook-with-args 'mh-compose-letter-function to subject cc))