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
(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
;;
(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))))))