AttachmentCollectionAdd(String, Byte) Method

Add an attachment.

Definition

Namespace: MimeKit
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public MimeEntity Add(
	string fileName,
	byte[] data
)

Parameters

fileName  String
The name of the file.
data  Byte
The file data to attach.

Return Value

MimeEntity
The newly added attachment MimeEntity.

Remarks

Adds the data as an attachment, using the specified file name for deducing the mime-type by extension and for setting the Content-Location.

Exceptions

ArgumentNullException

fileName is .

-or-

data is .

ArgumentException The specified file path is empty.

See Also