home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Best Objectech Shareware Selections
/
UNTITLED.iso
/
boss
/
word
/
text
/
019
/
mail.sl
< prev
next >
Wrap
Text File
|
1993-01-19
|
2KB
|
79 lines
;;
;; This file should only be loaded on unix systems. It opens a
;; process to /usr/ucb/mail. I am sure it can be easily modified
;; for other mail programs.
;;
(
[mail_cmd to subj beg] "" =subj "" =to
push_spot
bob
"---text follows this line---" fsearch
{
pop_spot
"Failed to find text divider." error
} !if
whatline =beg
bob
beg
{
bol "To:" looking_at {
3 right pop
push_mark eol bufsubstr =to
} if
bol "Subject:" looking_at {
8 right pop
push_mark eol bufsubstr =subj
} if
1 down pop
} loop
to strlen { pop_spot "Bad To: field." error } !if
;; mail command --- use sugar coated interface
"/usr/ucb/mail -s \"" subj strcat "\" " strcat to strcat =mail_cmd
beg goto_line
1 down { pop_spot "No message!" error } !if
push_mark
eob
"Sending..." message flush
mail_cmd pipe_region {
"Sending...done" message
0 set_buffer_modified_flag
} {
"No message sent." message
} else
pop_spot
) send
(
[mail_buf old] "*mail*" =mail_buf
mail_buf bufferp =old
mail_buf pop2buf
;; if buffer is not old, turn autosave on
old {
getbuf_info pop 2 setbuf_info
} !if
old {getbuf_info 1 & {pop pop pop return} if pop pop pop } if
erase_buffer
"wrap" setmode
"To: \nSubject: \n---text follows this line---\n" insert
bob eol
0 set_buffer_modified_flag
) mail