Class RMail::Message
In: rmail/message.rb
Parent: Object

The RMail::Message provides a way to read a RFC2822 message from an input stream and manipulate the header and body.

Methods
==    add_part    body    body=    decode    each    each_part    header    multipart?    new    part    to_s   
Attributes
:epilogue  [RW] 

Access the epilogue string for this message.

:preamble  [RW] 

Access the preamble string for this message.

Public Class methods
new()

Create a new, empty, RMail::Message.

Public Instance methods
==(other)

Test if this message is structured exactly the same as the other message. This is useful mainly for testing.

body()

Returns the body of the message as a string.

See also header.

body=(s)

Sets the body of the message to the given value. It should either be a string or an array of parts.

header()

Returns the RMail::Header object.

See also body.

multipart?()

Return true if the message consists of multiple parts.

add_part(part)

Add a part to the message.

decode()

Decode the body of this message.

This only works when the message is not a multipart.

part(i)

Get the indicated part from a multipart message.

to_s()

Returns the entire message in a single string.

each_part() {|part| ...}

Return each part of this message

FIXME: not tested

each() {|line| ...}

Call the supplied block for each line of the message. Each line will contain a trailing newline (\n).