X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=smtp.el;h=a3f97c662bb4b6e9d21c18d055b57816cfa91e61;hb=ed5904e50ab4019231d8a68a083996183d5a9eed;hp=0d3fef51511fe6207b366840485f1bbfcbe94a49;hpb=90ad3351f9a9b0b1fe7e46a4b557f35af995c995;p=elisp%2Fflim.git diff --git a/smtp.el b/smtp.el index 0d3fef5..a3f97c6 100644 --- a/smtp.el +++ b/smtp.el @@ -1,6 +1,6 @@ ;;; smtp.el --- basic functions to send mail with SMTP server -;; Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc. +;; Copyright (C) 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc. ;; Author: Tomoji Kagatani ;; Simon Leinen (ESMTP support) @@ -31,11 +31,11 @@ ;;; Code: -(require 'pces) (require 'custom) (require 'mail-utils) ; mail-strip-quoted-names (require 'sasl) (require 'luna) +(require 'mel) ; binary-funcall (defgroup smtp nil "SMTP protocol for sending mail." @@ -112,7 +112,8 @@ don't define this value." :group 'smtp-extensions) (defvar sasl-mechanisms) - + +;;;###autoload (defvar smtp-open-connection-function #'open-network-stream) (defvar smtp-read-point nil) @@ -234,12 +235,10 @@ to connect to. SERVICE is name of the service desired." Return a newly allocated connection-object. BUFFER is the buffer to associate with the connection. SERVER is name of the host to connect to. SERVICE is name of the service desired." - (let* ((coding-system-for-read 'binary) - (coding-system-for-write 'binary) - (process - (funcall smtp-open-connection-function - "SMTP" buffer server service)) - connection) + (let ((process + (binary-funcall smtp-open-connection-function + "SMTP" buffer server service)) + connection) (when process (setq connection (smtp-make-connection process server service)) (set-process-filter process 'smtp-process-filter) @@ -250,6 +249,7 @@ of the host to connect to. SERVICE is name of the service desired." ;;;###autoload (defun smtp-via-smtp (sender recipients buffer) + "Like `smtp-send-buffer', but sucks in any errors." (condition-case nil (progn (smtp-send-buffer sender recipients buffer) @@ -260,6 +260,10 @@ of the host to connect to. SERVICE is name of the service desired." ;;;###autoload (defun smtp-send-buffer (sender recipients buffer) + "Send a message. +SENDER is an envelope sender address. +RECIPIENTS is a list of envelope recipient addresses. +BUFFER may be a buffer or a buffer name which contains mail message." (let ((server (if (functionp smtp-server) (funcall smtp-server sender recipients) @@ -291,7 +295,9 @@ of the host to connect to. SERVICE is name of the service desired." (smtp-response-error (smtp-primitive-helo package))) (if smtp-use-starttls - (smtp-primitive-starttls package)) + (progn + (smtp-primitive-starttls package) + (smtp-primitive-ehlo package))) (if smtp-use-sasl (smtp-primitive-auth package)) (smtp-primitive-mailfrom package)