;; ;; Example for mailing from Siag ;; Assumes that sendmail is running on the local host ;; (define (mailto) (let ((s (s-open (gethostname) "smtp"))) (s-puts (string-append "helo " (gethostname) "\r\n") s) (s-force-output s) (writes nil (s-gets s)) (s-puts (string-append "mail from: " (cdr (assoc 'name (getpwuid (getuid)))) "@" (gethostname) "\r\n") s) (s-force-output s) (writes nil (s-gets s)) (s-puts (string-append "rcpt to: " (ask-for-str "To:" "") "\r\n") s) (s-force-output s) (writes nil (s-gets s)) (s-puts "data\r\n" s) (s-force-output s) (writes nil (s-gets s)) (html-table s) (s-puts "\r\n.\r\n" s) (s-force-output s) (writes nil (s-gets s)) (s-puts "quit\r\n" s) (s-force-output s) (writes nil (s-gets s)) (s-close s))) (define (html-table-cols a row col last) (cond ((<= col last) (s-puts (string-append "