struct Amber::Mailer::Attachment

Overview

Represents a file attachment to be included in an email message.

Attachments are encoded as base64 in the MIME message body and included as separate MIME parts with appropriate Content-Disposition headers.

Example

attachment = Attachment.new(
  filename: "report.pdf",
  content: File.read("report.pdf").to_slice,
  mime_type: "application/pdf"
)

Defined in:

amber/mailer/email.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(filename : String, content : Bytes, mime_type : String = "application/octet-stream") #

[View source]

Instance Method Detail

def content : Bytes #

[View source]
def content=(content : Bytes) #

[View source]
def filename : String #

[View source]
def filename=(filename : String) #

[View source]
def mime_type : String #

[View source]
def mime_type=(mime_type : String) #

[View source]