Class | MailFactory |
In: |
lib/mailfactory.rb
|
Parent: | Object |
An easy class for creating a mail message
VERSION | = | '1.4.0' |
adds an attachment to the mail. Type may be given as a mime type. If it is left off and the MIME::Types module is available it will be determined automagically. If the optional attachemntheaders is given, then they will be added to the attachment boundary in the email, which can be used to produce Content-ID markers. attachmentheaders can be given as an Array or a String.
adds an attachment to the mail as emailfilename. Type may be given as a mime type. If it is left off and the MIME::Types module is available it will be determined automagically. file may be given as an IO stream (which will be read until the end) or as a filename. If the optional attachemntheaders is given, then they will be added to the attachment boundary in the email, which can be used to produce Content-ID markers. attachmentheaders can be given as an Array of a String.
builds an email and returns it as a string. Takes the following options:
:messageid: | Adds a message id to the message based on the from header (defaults to false) |
:date: | Adds a date to the message if one is not present (defaults to true) |
implement method missing to provide helper methods for setting and getting headers. Headers with ’-’ characters may be set/gotten as ‘x_mailer’ or ‘XMailer’ (splitting will occur between capital letters or on ‘_’ chracters)
builds a boundary string for including attachments in the body, expects an attachment hash as built by add_attachment and add_attachment_as
Quote the given address if it needs to be. The address may be a regular email address, or it can be a phrase followed by an address in brackets. The phrase is the only part that will be quoted, and only if it needs to be. This allows extended characters to be used in the "to", "from", "cc", and "bcc" headers.