* wl-draft.el (wl-draft-smtp-send-buffer): New function (for compatibility).
authorteranisi <teranisi>
Wed, 22 Nov 2000 11:08:18 +0000 (11:08 +0000)
committerteranisi <teranisi>
Wed, 22 Nov 2000 11:08:18 +0000 (11:08 +0000)
 (wl-draft-send-mail-with-smtp): Use it.

wl/ChangeLog
wl/wl-draft.el

index 295b642..5cdda0e 100644 (file)
@@ -1,5 +1,9 @@
 2000-11-22  Yuuichi Teranishi  <teranisi@gohome.org>
 
+       * wl-draft.el (wl-draft-smtp-send-buffer): New function
+       (for compatibility).
+       (wl-draft-send-mail-with-smtp): Use it.
+
        * wl-summary.el (wl-summary-save-view-cache):
        Delete duplicated `write-region';
        Use `write-region-as-binary' instead of `as-binary-output-file' and
index 9edf607..c3402dc 100644 (file)
@@ -918,6 +918,27 @@ non-nil."
          (setq fields (cdr fields)))
        recipients))))
 
+(static-if (fboundp 'smtp-send-buffer)
+(defun wl-draft-smtp-send-buffer (sender recipients buffer id)
+  (wl-smtp-extension-bind
+   (condition-case err
+       (smtp-send-buffer sender recipients (current-buffer))
+     (error
+      (wl-draft-write-sendlog 'failed 'smtp smtp-server
+                             recipients id)
+      (signal (car err) (cdr err))))))
+(defun wl-draft-smtp-send-buffer (sender recipients buffer id)
+  (as-binary-process
+   (wl-smtp-extension-bind
+    (let ((err (smtp-via-smtp sender recipients
+                             (current-buffer))))
+      (when (not (eq err t))
+       (wl-draft-write-sendlog 'failed 'smtp smtp-server
+                               recipients id)
+       (error "Sending failed; SMTP protocol error:%s" err))))))
+;; end of static-if
+)
+
 ;;
 ;; from Semi-gnus
 ;;
@@ -976,18 +997,12 @@ non-nil."
            (wl-draft-delete-field "bcc" delimline)
            (wl-draft-delete-field "resent-bcc" delimline)
            (let (process-connection-type)
-             (as-binary-process
-              (when recipients
-                (wl-smtp-extension-bind
-                 (let ((err (smtp-via-smtp sender recipients
-                                           (current-buffer))))
-                   (when (not (eq err t))
-                     (wl-draft-write-sendlog 'failed 'smtp smtp-server
-                                             recipients id)
-                     (error "Sending failed; SMTP protocol error:%s" err))))
-                (wl-draft-set-sent-message 'mail 'sent)
-                (wl-draft-write-sendlog
-                 'ok 'smtp smtp-server recipients id)))))
+             (when recipients
+               (wl-draft-smtp-send-buffer sender recipients (current-buffer)
+                                          id)
+               (wl-draft-set-sent-message 'mail 'sent)
+               (wl-draft-write-sendlog
+                'ok 'smtp smtp-server recipients id))))
        (if (bufferp errbuf)
            (kill-buffer errbuf))))))