Class Mail
In: lib/mailread.rb
Parent: Object

The Mail class represents an internet mail message (as per RFC822, RFC2822) with headers and a body.

Methods

[]   body   header   new  

Public Class methods

Create a new Mail where f is either a stream which responds to gets(), or a path to a file. If f is a path it will be opened.

The whole message is read so it can be made available through the header, #[] and body methods.

The "From " line is ignored if the mail is in mbox format.

Public Instance methods

Return the header corresponding to field.

Matching is case-insensitive.

Return the message body as an Array of lines

Return the headers as a Hash.

[Validate]

ruby-doc.org is a service of James Britt and Rising Tide Software, a Ruby application development company in Phoenix, AZ.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.