Class MailService.Attachment (2.0.0)

public static class MailService.Attachment

Inheritance

java.lang.Object > MailService.Attachment

Constructors

Attachment(String fileName, byte[] data)

public Attachment(String fileName, byte[] data)

Attachments are an optional part of messages, but if present, all information about them must be provided.

Parameters
NameDescription
fileNameString

The attachment must have a filename associated with it. The extension on that filename must be present and not blocked, or there will be a failure at send time.

databyte[]

An array with arbitrary byte content. The array must be be present, but may be of zero length.

Attachment(String fileName, byte[] data, @Nullable String contentID)

public Attachment(String fileName, byte[] data, @Nullable String contentID)

Attachments are an optional part of messages, but if present, all information about them must be provided.

Parameters
NameDescription
fileNameString

The attachment must have a filename associated with it. The extension on that filename must be present and blocked, or there will be a failure at send time.

databyte[]

An array with arbitrary byte content. The array must be be present, but may be of zero length.

contentID@org.checkerframework.checker.nullness.qual.Nullable java.lang.String

The attachment's content ID. May be null.

Methods

getContentID()

public @Nullable String getContentID()
Returns
TypeDescription
@org.checkerframework.checker.nullness.qual.Nullable java.lang.String

getData()

public byte[] getData()

Gets the content of this attachment.

Returns
TypeDescription
byte[]

The raw data of this attachment.

getFileName()

public String getFileName()

Gets the file name of this attachment.

Returns
TypeDescription
String

The file name of this attachment.