Newsgroups: fj.editor.emacs
Path: galaxy.trc.rwcp.or.jp!coconuts.jaist!wnoc-tyo-news!spinnews!aps02!yoshi
From: yoshi@bsi.co.jp (Takehiko Yosida)
Subject: Re: Mime mail header on emacs mail
In-Reply-To: ko@chi.co.jp's message of 4 Jul 94 02:31:38 GMT
Message-ID: <YOSHI.94Jul5135801@mango.bsi.co.jp>
Sender: news@bsi.co.jp
Nntp-Posting-Host: mango
Organization: Bussan Systems Integration Co., Ltd. Tokyo, Japan.
References: <YOSHI.94Jul2164702@mango.bsi.co.jp>
	<KO.94Jul4113138@takuan.chi.co.jp>
Distribution: fj
Date: Tue, 5 Jul 1994 04:58:01 GMT
Lines: 62
Xref: galaxy.trc.rwcp.or.jp fj.editor.emacs:4799
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.editor.emacs&nb=4799&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

$B5HED!w#B#S#I$G$9!#(B

In article <KO.94Jul4113138@takuan.chi.co.jp> ko@chi.co.jp (Kenji Konaka) writes:

 |$B$3$J$+!w%+%$$H$$$$$^$9!#(B

($BCfN,(B)

 |
 |$B$KJQ$($k!"$H$$$&$N$G$O$I$&$G$7$g$&!)(B
 |$B!JJQ$J$N$+$b$7$l$J$$!D!D!K(B

$B$*$+$2$5$^$G!"(BMime$B$N%X%C%@$,F~$k$h$&$K$J$j$^$7$?!#$I$&$b$"$j$,$H$&(B
$B$4$6$$$^$7$?!#(B
~/.emacs$B%U%!%$%k$K!"0J2<$N%3!<%I$rF~$l$k$3$H$G!"2r7h$7$^$7$?!#(B

(load "tiny-mime")
(setq rmail-show-message-hook
        '(lambda ()
                (toggle-read-only)
                (mime/decode-message-header)
                (toggle-read-only)))
(setq send-mail-function
        '(lambda ()
                (mime/encode-message-header)
                (mail-mv)
                (mail-ct)
                (sendmail-send-it)))
;
; add Mime haeder in mail-mode
(defun mail-mv ()
"Move point to end of Mime-Version field.  Create a Mime-Version field if none."
(interactive)
  (expand-abbrev)
  (or (mail-position-on-field "mime-version" t)
      (let (end)
        (mail-position-on-field "to")
        (re-search-forward
         (concat "^" (regexp-quote mail-header-separator) "\n"))
        (setq end (- (match-beginning 0) 1))
        (goto-char end)
        (insert "\nMime-Version: 1.0"))))

(defun mail-ct ()
"Move point to end of Content-Type field.  Create a Content-Type field if none."
  (interactive)
  (expand-abbrev)
  (or (mail-position-on-field "content-type" t)
      (let (end)
        (mail-position-on-field "to")
        (re-search-forward
         (concat "^" (regexp-quote mail-header-separator) "\n"))
        (setq end (- (match-beginning 0) 1))
        (goto-char end)
        (insert "\nContent-Type: text/plain; charset=iso-2022-jp"))))


--
-------------
 Takehiko Yoshida
 Bussan System Integration Co., Ltd.  Tokyo, Japan.
 Mail: yoshi@bsi.co.jp, SGU01033@niftyserve.or.jp
