Class RMail::Message
In: lib/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.

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

Access the epilogue string for this message.

:preamble  [RW] 

Access the preamble string for this message.

Public Class methods

Create a new, empty, RMail::Message.

Public Instance methods

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


Returns the body of the message as a String or Array. If #multipart? returns false, it will be a String, otherwise an Array.

See also #header.


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


Returns the RMail::Header object.

See also #body.


Return true if the message consists of multiple parts.


Add a part to the message. After this message is called, the #multipart? method will return true and the #body method will #return an array of parts.


Decode the body of this message.

If the body of this message is encoded with quoted-printable or base64, this function will decode the data into its original form and return it. If the body is not encoded, it is returned unaltered.

This only works when the message is not a multipart.


Get the indicated part from a multipart message.


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).

set_delimiters(delimiters, boundary)