Class

Mail

Inheritance
< Object

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

Methods

Class

Visibility Signature
public new (f)

Instance

Visibility Signature
public [] (field)
public body ()
public header ()

Class Method Detail

new(f)

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.

Instance Method Detail

[](field)

Return the header corresponding to field.

Matching is case-insensitive.

body()

Return the message body as an Array of lines

header()

Return the headers as a Hash.