< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事
N :次の記事
|<:スレッドの先頭
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
青木です。
In mail "[ruby-list:38050] TMail multipart mail"
Yoshiki Wada <ysk / rc5.so-net.ne.jp> wrote:
> 和田と申します。
>
> TMailでマルチパートメールを作成したいのですが、うまくいっていません。
> 以下のようなスクリプトを実行すると、エラーで終了します。
確認しました。
かなり変更しているのでパッチが当たらないような気がしますが、
念のために付けときます。
> mail.set_content_type('multipart', 'mixed')
とりあえず、この set_content_type を抜いてみてください。
必要なときは encoded が勝手に付けてくれます。
-------------------------------------------------------------------
青木峰郎
diff -u -p -r1.35 mail.rb
--- mail.rb 21 May 2003 07:11:58 -0000 1.35
+++ mail.rb 7 Aug 2003 09:33:44 -0000
@@ -877,15 +877,20 @@ module TMail
if multipart?
read_multipart f
else
- @body_port = @config.new_body_port(self)
- @body_port.wopen {|w|
- w.write f.read
- }
+ read_singlepart f
end
end
+
+ def read_singlepart( f )
+ @body_port = @config.new_body_port(self)
+ @body_port.wopen {|w|
+ w.write f.read
+ }
+ end
def read_multipart( src )
- bound = @header['content-type'].params['boundary']
+ bound = type_param('boundary')
+ return read_singlepart(src) unless bound
is_sep = /\A--#{Regexp.quote bound}(?:--)?[ \t]*(?:\n|\r\n|\r)/
lastbound = "--#{bound}--"