From: Geo _C Date: 2008-09-12T01:29:26+09:00 Subject: Re: Extract data from email - Tmail, Hpricot I got Tmail to extract the body of my email. The solution (very simple and embarrassing) is below. Now I'm trying to figure out Hpricot, but examples seem to be fairly thin. If anyone knows of a good tutorial for beginners, please post. I have been using http://code.whytheluckystiff.net/doc/hpricot/ , but could use something more basic. Thanks for the help! Thomas Sawyer wrote: > On Sep 8, 11:31�am, Geo _C wrote: >> > It would help if you posted some code that didn't work, so people can >> require 'rubygems' >> require 'tmail' >> >> email = TMail::Mail.load( 'emailhtml.eml' ) >> >> puts email['body'] # comes back nil > > Don't see why it would be nil. I would contact Mikel. I needed to use email.body instead of email['body'] to return the body. thanks Peter! > > http://lindsaar.net/ > >> puts email['from'] >> puts email['Delivered-To'] >> puts email['to'] # comes back nil > > I don't see a 'to' in the header, so is this a surprise? My mistake there. You are correct, there is no 'to' for me to use. > >> Tue, 2 Sep 2008 19:05:00 -0400 >> 02 Sep 2008 23:10:35.0578 (UTC) FILETIME=[1B2659A0:01C90D51] > > T. -- Posted via http://www.ruby-forum.com/.