changeset 24773:424bc3b2a6ef

(smtpmail-send-it): Bind smtpmail-code-conv-from properly. (smtpmail-send-data-1): If DATA is a multibyte string, encode it by smtpmail-code-conv-from.
author Kenichi Handa <handa@m17n.org>
date Tue, 25 May 1999 11:12:17 +0000
parents 2c99e81da802
children 99f69a5b41f4
files lisp/mail/smtpmail.el
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/smtpmail.el	Tue May 25 10:54:45 1999 +0000
+++ b/lisp/mail/smtpmail.el	Tue May 25 11:12:17 1999 +0000
@@ -122,7 +122,11 @@
 	(tembuf (generate-new-buffer " smtpmail temp"))
 	(case-fold-search nil)
 	delimline
-	(mailbuf (current-buffer)))
+	(mailbuf (current-buffer))
+	(smtpmail-code-conv-from
+	 (if enable-multibyte-characters
+	     (let ((sendmail-coding-system smtpmail-code-conv-from))
+	       (select-message-coding-system)))))
     (unwind-protect
 	(save-excursion
 	  (set-buffer tembuf)
@@ -564,8 +568,10 @@
 (defun smtpmail-send-data-1 (process data)
   (goto-char (point-max))
 
-  (when smtpmail-code-conv-from
-    (setq data (encode-coding-string data *internal* smtpmail-code-conv-from)))
+  (if (and (multibyte-string-p data)
+	   smtpmail-code-conv-from)
+      (setq data (string-as-multibyte
+		  (encode-coding-string data smtpmail-code-conv-from))))
 	
   (if smtpmail-debug-info
       (insert data "\r\n"))