Click or drag to resize
MimeKit

AttachmentCollectionAdd(String, Byte) Method

Add an attachment.

Namespace: MimeKit
Assembly: MimeKit (in MimeKit.dll) Version: 4.3.0
Syntax
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.
Exceptions
ExceptionCondition
ArgumentNullException

fileName is null.

-or-

data is null.

ArgumentException The specified file path is empty.
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.

See Also