summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlnu <lnu@f70e237a-67f3-0310-a06c-d2b8a7116972>2006-07-18 21:53:06 +0000
committerlnu <lnu@f70e237a-67f3-0310-a06c-d2b8a7116972>2006-07-18 21:53:06 +0000
commit5eb10f0ee87a84103dd605efa16783dfeec53a54 (patch)
tree033509032fc3d8191c6e4b7cd8cec7c48d3dfba8 /lib
parenta7e4638feee8c58aa2e1178815848ee694eca8b9 (diff)
downloadfeed2imap-5eb10f0ee87a84103dd605efa16783dfeec53a54.tar.gz
feed2imap-5eb10f0ee87a84103dd605efa16783dfeec53a54.tar.bz2
feed2imap-5eb10f0ee87a84103dd605efa16783dfeec53a54.zip
ruby-feedparser0.3
git-svn-id: svn+ssh://svn.gna.org/svn/feed2imap/trunk/feed2imap@104 f70e237a-67f3-0310-a06c-d2b8a7116972
Diffstat (limited to 'lib')
-rw-r--r--lib/feed2imap/itemtomail.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/feed2imap/itemtomail.rb b/lib/feed2imap/itemtomail.rb
index 2f569b9..4a6284f 100644
--- a/lib/feed2imap/itemtomail.rb
+++ b/lib/feed2imap/itemtomail.rb
@@ -82,7 +82,11 @@ def item_to_mail(item, index, updated, from = 'Feed2Imap')
htmlpart = RMail::Message::new
htmlpart.header['Content-Type'] = 'text/html; charset=utf-8'
htmlpart.header['Content-Transfer-Encoding'] = '7bit'
- htmlpart.body = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><body>' + item.to_html + '</body></html>'
+ if item.respond_to?(:to_html_with_headers)
+ htmlpart.body = item.to_html_with_headers
+ else
+ htmlpart.body = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><body>' + item.to_html + '</body></html>'
+ end
message.add_part(textpart)
message.add_part(htmlpart)
return message.to_s