Module | TMail
In: | lib/tmail/address.rb lib/tmail/mailbox.rb lib/tmail/mail.rb lib/tmail/encode.rb lib/tmail/attachments.rb lib/tmail/net.rb lib/tmail/utils.rb lib/tmail/port.rb lib/tmail/quoting.rb lib/tmail/parser.rb lib/tmail/interface.rb lib/tmail/header.rb ext/tmailscanner/tmail/tmailscanner.c

                             ruby interface

### Methods

decoded encoded new_boundary new_message_id to_s

### Classes and Modules

Module TMail::MailFlags
Module TMail::TextUtils
Class TMail::Address
Class TMail::AddressGroup
Class TMail::AddressHeader
Class TMail::Attachment
Class TMail::ContentDispositionHeader
Class TMail::ContentTransferEncodingHeader
Class TMail::ContentTypeHeader
Class TMail::DateTimeHeader
Class TMail::EncryptedHeader
Class TMail::FilePort
Class TMail::HeaderField
Class TMail::KeywordsHeader
Class TMail::Mail
Class TMail::Maildir
Class TMail::MaildirPort
Class TMail::MessageIdHeader
Class TMail::MhMailbox
Class TMail::MhPort
Class TMail::MimeVersionHeader
Class TMail::Parser
Class TMail::Port
Class TMail::ReceivedHeader
Class TMail::ReferencesHeader
Class TMail::ReturnPathHeader
Class TMail::SingleAddressHeader
Class TMail::StringPort
Class TMail::StructuredHeader
Class TMail::SyntaxError
Class TMail::TMailScanner
Class TMail::UNIXMbox
Class TMail::Unquoter
Class TMail::UnstructuredHeader

### Constants

MhLoader | = | MhMailbox
MboxLoader | = | UNIXMbox
MaildirLoader | = | Maildir

### Public Class methods

new_boundary()

Provides a new email boundary to separate parts of the email. This is a random string based off the current time, so should be fairly unique.

For Example:

     TMail.new_boundary
     #=> "mimepart_47bf656968207_25a8fbb80114"
     TMail.new_boundary
     #=> "mimepart_47bf66051de4_25a8fbb80240"

[Source]

    # File lib/tmail/utils.rb, line 67
      def TMail.new_boundary
        'mimepart_' + random_tag
      end

new_message_id( fqdn = nil )

Provides a new email message ID. You can use this to generate unique email message id‘s for your email so you can track them.

Optionally takes a fully qualified domain name (default to the current hostname returned by Socket.gethostname) that will be appended to the message ID.

For Example:

     email.message_id = TMail.new_message_id
     #=> "<47bf66845380e_25a8fbb80332@baci.local.tmail>"
     email.to_s
     #=> "Message-Id: <47bf668b633f1_25a8fbb80475@baci.local.tmail>\n\n"
     email.message_id = TMail.new_message_id("lindsaar.net")
     #=> "<47bf668b633f1_25a8fbb80475@lindsaar.net.tmail>"
     email.to_s
     #=> "Message-Id: <47bf668b633f1_25a8fbb80475@lindsaar.net.tmail>\n\n"

[Source]

    # File lib/tmail/utils.rb, line 87
      def TMail.new_message_id( fqdn = nil )
        fqdn ||= ::Socket.gethostname
        "<#{random_tag()}@#{fqdn}.tmail>"
      end

### Public Instance methods

decoded( eol = "\n", charset = 'e', dest = nil )

Returns the TMail object decoded and ready to be used by you, your program etc.

You should call this before you are packaging up your email to correctly escape all the values that need escaping in the email, line wrap the email etc.

For Example:

     email = TMail::Load(my_email_file)
     email_to_send = email.encoded

[Source]

    # File lib/tmail/encode.rb, line 88
        def decoded( eol = "\n", charset = 'e', dest = nil )
          # Turn the E-Mail into a string and return it with all
          # encoded characters decoded.  alias for to_s
          accept_strategy Decoder, eol, charset, dest
        end

encoded( eol = "\r\n", charset = 'j', dest = nil )

You should call this before you are packaging up your email to correctly escape all the values that need escaping in the email, line wrap the email etc.

It is also a good idea to call this before you marshal or serialize a TMail object.

For Example:

     email = TMail::Load(my_email_file)
     email_to_send = email.encoded

[Source]

    # File lib/tmail/encode.rb, line 73
        def encoded( eol = "\r\n", charset = 'j', dest = nil )
          accept_strategy Encoder, eol, charset, dest
        end

to_s( eol = "\n", charset = 'e', dest = nil )

Alias for decoded

[Validate]