Attachment CollectionAdd(String, Byte, Content Type) Method
Add an attachment.
Definition
Namespace: MimeKit
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
The newly added attachment MimeEntity.
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public MimeEntity Add(
string fileName,
byte[] data,
ContentType contentType
)Parameters
- fileName String
- The name of the file.
- data Byte
- The file data.
- contentType ContentType
- The mime-type of the file.
Return Value
MimeEntityThe newly added attachment MimeEntity.
Remarks
Adds the specified data as an attachment using the supplied Content-Type.
The file name parameter is used to set the Content-Location.
For a list of known mime-types and their associated file extensions, see http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
Exceptions
| ArgumentNullException |
fileName is . -or- data is . -or- contentType is . |
| ArgumentException | The specified file path is empty. |