aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/mail/smtpmail.el50
1 files changed, 24 insertions, 26 deletions
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 5a9fff1b6de..74b065a471a 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -160,8 +160,8 @@ don't define this value.")
160 160
161 (if (not (null smtpmail-recipient-address-list)) 161 (if (not (null smtpmail-recipient-address-list))
162 (if (not (smtpmail-via-smtp smtpmail-recipient-address-list tembuf)) 162 (if (not (smtpmail-via-smtp smtpmail-recipient-address-list tembuf))
163 (error "Sending... Failed. SMTP Protocol Error.")) 163 (error "Sending failed; SMTP protocol error"))
164 (error "Sending... failed. No recipients.")) 164 (error "Sending failed; no recipients"))
165 ) 165 )
166 (kill-buffer tembuf) 166 (kill-buffer tembuf)
167 (if (bufferp errbuf) 167 (if (bufferp errbuf)
@@ -177,13 +177,11 @@ don't define this value.")
177 177
178(defun smtpmail-via-smtp (recipient smtpmail-text-buffer) 178(defun smtpmail-via-smtp (recipient smtpmail-text-buffer)
179 (let ((process nil) 179 (let ((process nil)
180 host 180 (host smtpmail-smtp-server)
181 port 181 (port smtpmail-smtp-service)
182 response-code 182 response-code
183 ) 183 greeting
184 (setq host smtpmail-smtp-server) 184 process-buffer)
185 (setq port smtpmail-smtp-service)
186
187 (unwind-protect 185 (unwind-protect
188 (catch 'done 186 (catch 'done
189 ;; get or create the trace buffer 187 ;; get or create the trace buffer
@@ -234,17 +232,17 @@ don't define this value.")
234 ) 232 )
235 233
236 ;; RCPT TO: <recipient> 234 ;; RCPT TO: <recipient>
237 (setq n 0) 235 (let ((n 0))
238 (while (not (null (nth n recipient))) 236 (while (not (null (nth n recipient)))
239 (smtpmail-send-command process (format "RCPT TO: %s" (nth n recipient))) 237 (smtpmail-send-command process (format "RCPT TO: %s" (nth n recipient)))
240 (setq n (1+ n)) 238 (setq n (1+ n))
241 239
242 (if (or (null (car (setq response-code (smtpmail-read-response process)))) 240 (if (or (null (car (setq response-code (smtpmail-read-response process))))
243 (not (integerp (car response-code))) 241 (not (integerp (car response-code)))
244 (>= (car response-code) 400)) 242 (>= (car response-code) 400))
245 (throw 'done nil) 243 (throw 'done nil)
246 ) 244 )
247 ) 245 ))
248 246
249 ;; DATA 247 ;; DATA
250 (smtpmail-send-command process "DATA") 248 (smtpmail-send-command process "DATA")
@@ -441,13 +439,13 @@ don't define this value.")
441 (while (re-search-forward "[ \t]+" header-end t) (replace-match " ")) 439 (while (re-search-forward "[ \t]+" header-end t) (replace-match " "))
442 440
443 (goto-char (point-min)) 441 (goto-char (point-min))
444 (setq recipient-address-list nil) 442 (let (recipient-address-list)
445 (while (re-search-forward " [^ ]+ " (point-max) t) 443 (while (re-search-forward " [^ ]+ " (point-max) t)
446 (backward-char 1) 444 (backward-char 1)
447 (setq recipient-address-list(cons (buffer-substring (match-beginning 0) (match-end 0)) 445 (setq recipient-address-list(cons (buffer-substring (match-beginning 0) (match-end 0))
448 recipient-address-list)) 446 recipient-address-list))
449 ) 447 )
450 (setq smtpmail-recipient-address-list recipient-address-list) 448 (setq smtpmail-recipient-address-list recipient-address-list))
451 449
452 ) 450 )
453 ) 451 )