class MIME::Mail

Construct RFC 2822 Internet messages.



Public Class Methods

new(content = nil) click to toggle source

Initialize a Mail object with body set to content.

# File lib/mime/mail.rb, line 18
def initialize content = nil
  @headers =
  self.body = content =

Public Instance Methods

body=(content) click to toggle source
# File lib/mime/mail.rb, line 41
def body= content
  @body = content.is_a?(Media) ? content :
to_s() click to toggle source

Format the Mail object as an Internet message.

# File lib/mime/mail.rb, line 27
def to_s
  self.sender       ||= sender_address
  self.message_id   ||= ID.generate_gid(domain)
  body.mime_version ||= "1.0 (Ruby MIME v#{VERSION})"

  # In an RFC 2822 message, the header and body sections must be separated
  # by two line breaks (i.e., 2*CRLF). One line break is deliberately
  # omitted here so the MIME body supplier can append headers to the
  # top-level message header section.