Athena::MIME::Email
Inherits Athena::MIME::Message < Reference < Object
Provides a high-level API for creating an email.
email = AMIME::Email
.new
.from("me@example.com")
.to("you@example.com")
.cc("them@example.com")
.bcc("other@example.com")
.reply_to("me@example.com")
.priority(:high)
.subject("Important Notification")
.text("Lorem ipsum...")
.html("<h1>Lorem ipsum</h1> <p>...</p>")
.attach_from_path("/path/to/file.pdf", "my-attachment.pdf")
.embed_from_path("/path/to/logo.png")
# ...
Instance methods
Appends the provided addresses to the list of current bcc addresses.
Appends the provided addresses to the list of current cc addresses.
Appends the provided addresses to the list of current from addresses.
Adds the provided part as an email attachment.
Consider using #attach or #embed or one of their variants to provide a simpler API.
Appends the provided addresses to the list of current reply-to addresses.
Appends the provided addresses to the list of current to addresses.
Adds an attachment with the provided body, optionally with the provided name and content_type.
Attaches the file at the provided path as an attachment, optionally with the provided name and content_type.
Sets the cc addresses of this email to the provided addresses, overriding any previously added ones.
Sets the cc addresses of this email to the provided addresses, overriding any previously added ones.
Adds an embedded attachment with the provided body, optionally with the provided name and content_type.
Embeds the file at the provided path as an attachment, optionally with the provided name and content_type.
Asserts that this message is in a valid state to be sent, raising an AMIME::Exception::Logic error if not.
Sets the from addresses of this email to the provided addresses, overriding any previously added ones.
Sets the HTML content of this email to the provided body, optionally with the provided charset.
Sets the priority of this email to the provided priority.
Sets the reply-to addresses of this email to the provided addresses, overriding any previously added ones.
Sets the return path of this email to the provided address.
Sets the sender of this email to the provided address.
Sets the textual content of this email to the provided body, optionally with the provided charset.