bin/email: Get e-mail body from stdin
parent
e201b99f6a
commit
0b933d3b52
|
@ -19,8 +19,11 @@
|
||||||
(error (format "Missing ~/.authinfo.gpg. Need the following:
|
(error (format "Missing ~/.authinfo.gpg. Need the following:
|
||||||
machine %s login MYLOGIN port 25 password MYPASSWORD" smtpmail-smtp-server)))
|
machine %s login MYLOGIN port 25 password MYPASSWORD" smtpmail-smtp-server)))
|
||||||
|
|
||||||
(when (< (length command-line-args-left) 3)
|
(when (< (length command-line-args-left) 2)
|
||||||
(error (format "Usage: %s SUBJECT BODY-FILE TO..." (file-name-nondirectory (nth 2 command-line-args)))))
|
(error (format "Usage: %s SUBJECT TO...
|
||||||
|
|
||||||
|
The e-mail body is read from the standard input (stdin)."
|
||||||
|
(file-name-nondirectory (nth 2 command-line-args)))))
|
||||||
|
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert (format "
|
(insert (format "
|
||||||
|
@ -31,7 +34,7 @@ Subject: %s
|
||||||
|
|
||||||
"
|
"
|
||||||
user-full-name user-mail-address
|
user-full-name user-mail-address
|
||||||
(mapconcat 'identity (cddr command-line-args-left) ", ")
|
(mapconcat 'identity (cdr command-line-args-left) ", ")
|
||||||
(nth 0 command-line-args-left)))
|
(nth 0 command-line-args-left)))
|
||||||
(insert-file-contents-literally (nth 1 command-line-args-left))
|
(insert (read-from-minibuffer ""))
|
||||||
(message-send))
|
(message-send))
|
||||||
|
|
Loading…
Reference in New Issue