Represents an e-mail attachment. More...
Inherits Aspose::Email::AttachmentBase, and Aspose::Email::IPreferredTextEncodingProvider.
Inherited by Aspose::Email::ReferenceAttachment.
Public Member Functions | |
bool | get_IsTnef () |
Gets a value indicating whether the attachment is TNEF formatted message. More... | |
bool | get_IsEmbeddedMessage () |
Gets a value indicating whether the attachment is an embedded message. More... | |
System::String | get_Name () |
Gets an attachment name More... | |
void | set_Name (System::String value) |
Sets an attachment name More... | |
System::SharedPtr< System::Text::Encoding > | get_NameEncoding () |
Gets an encoding of attachment name More... | |
void | set_NameEncoding (System::SharedPtr< System::Text::Encoding > value) |
Sets an encoding of attachment name More... | |
System::SharedPtr< Aspose::Email::Mime::ContentDisposition > | get_ContentDisposition () |
Gets Content-Disposition header More... | |
bool | get_IsUri () const |
Gets a value indicating whether attachment is URI-attachment. More... | |
System::SharedPtr< ObjectIdentifier > | get_Id () const |
Object identifier More... | |
System::String | get_CreatedName () const |
Created name from subject in case when attacment is message/rfc822 More... | |
void | set_CreatedName (System::String value) |
Created name from subject in case when attacment is message/rfc822 More... | |
System::SharedPtr< System::Text::Encoding > | get_PreferredTextEncoding () override |
Gets a preferred text encoding More... | |
void | set_PreferredTextEncoding (System::SharedPtr< System::Text::Encoding > value) override |
Sets a preferred text encoding More... | |
Attachment (System::String fileName) | |
Initializes a new instance of the Attachment class. More... | |
Attachment (System::String fileName, System::String mediaType) | |
Initializes a new instance of the Attachment class. More... | |
Attachment (System::String fileName, System::SharedPtr< Aspose::Email::Mime::ContentType > contentType) | |
Initializes a new instance of the Attachment class. More... | |
Attachment (System::SharedPtr< System::IO::Stream > contentStream, System::String name) | |
Initializes a new instance of the Attachment class. More... | |
Attachment (System::SharedPtr< System::IO::Stream > contentStream, System::String name, System::String mediaType) | |
Initializes a new instance of the Attachment class. More... | |
Attachment (System::SharedPtr< System::IO::Stream > contentStream, System::SharedPtr< Aspose::Email::Mime::ContentType > contentType) | |
Initializes a new instance of the Attachment class. More... | |
Attachment () | |
Attachment (System::SharedPtr< System::IO::MemoryStream > content, System::SharedPtr< Aspose::Email::Mime::ContentType > contentType, System::String name, System::String contentLocation, System::String contentId) | |
Attachment (System::SharedPtr< Aspose::Email::Mime::MimePart > part) | |
Initializes a new instance of the Attachment class. More... | |
System::SharedPtr< Attachment > | Clone () |
System::SharedPtr< Calendar::Model::Property::AttachmentProperty > | ToCalendarAttachmentProperty () |
System::SharedPtr< Mapi::MapiAttachment > | ConvertToMapiAttachment (Mapi::OutlookMessageFormat format, int32_t codePage, int32_t count, bool preserveDates) override |
System::String | CreateName (int32_t attachmentNumber) |
Public Member Functions inherited from Aspose::Email::AttachmentBase | |
System::SharedPtr< System::IO::Stream > | get_ContentStream () |
Gets the content stream. More... | |
void | set_ContentStream (System::SharedPtr< System::IO::Stream > value) |
Sets the content stream. More... | |
System::String | get_ContentId () |
Gets the content id. More... | |
void | set_ContentId (System::String value) |
Sets the content id. More... | |
virtual System::SharedPtr< Mime::HeaderCollection > | get_Headers () |
Gets headers collection of attachment. More... | |
System::SharedPtr< Aspose::Email::Mime::ContentType > | get_ContentType () |
Gets the type of the content. More... | |
void | set_ContentType (System::SharedPtr< Aspose::Email::Mime::ContentType > value) |
Sets the type of the content. More... | |
Aspose::Email::Mime::TransferEncoding | get_TransferEncoding () |
Gets the transfer encoding. More... | |
void | set_TransferEncoding (Aspose::Email::Mime::TransferEncoding value) |
Sets the transfer encoding. More... | |
System::SharedPtr< System::Uri > | get_ContentLocation () const |
Gets the content location. More... | |
void | set_ContentLocation (System::SharedPtr< System::Uri > value) |
Sets the content location. More... | |
System::String | get_ItemId () const |
void | set_ItemId (System::String value) |
System::SharedPtr< Aspose::Email::Mime::MimePart > | get_MimePart () const |
Gets the MIME part. More... | |
void | set_MimePart (System::SharedPtr< Aspose::Email::Mime::MimePart > value) |
Sets the MIME part. More... | |
bool | get_Hidden () |
void | set_Hidden (bool value) |
virtual void | SaveInternal (System::SharedPtr< System::IO::Stream > stream) |
Saves the specified stream. More... | |
virtual void | Save (System::SharedPtr< System::IO::Stream > stream) |
Saves the specified stream. More... | |
virtual void | Save (System::String fileName) |
Saves the specified file name. More... | |
void | SetContentFromString (System::String contentString, System::SharedPtr< Aspose::Email::Mime::ContentType > contentType) |
Sets the content from string. More... | |
void | SetContentFromString (System::String contentString, System::SharedPtr< System::Text::Encoding > encoding, System::String mediaType) |
Sets the content from string. More... | |
void | SetContentFromString (System::String contentString, System::SharedPtr< System::Text::Encoding > encoding, System::SharedPtr< Aspose::Email::Mime::ContentType > contentType, Aspose::Email::Mime::TransferEncoding te) |
Sets the content from string. More... | |
void | SetSTnefContent (System::ArrayPtr< uint8_t > data) |
Sets the S/TNEF content. More... | |
virtual void | PrepareForSending () |
Prepares for sending. More... | |
void | Dispose () override |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More... | |
Static Public Member Functions | |
static System::SharedPtr< Attachment > | CreateAttachmentFromString (System::String content, System::String name) |
Creates the attachment from string. More... | |
static System::SharedPtr< Attachment > | CreateAttachmentFromString (System::String content, System::String name, System::SharedPtr< System::Text::Encoding > contentEncoding, System::String mediaType) |
Creates the attachment from string. More... | |
static System::SharedPtr< Attachment > | CreateAttachmentFromString (System::String content, System::SharedPtr< Aspose::Email::Mime::ContentType > contentType) |
Creates the attachment from string. More... | |
Public Attributes | |
int32_t | CollectionNum |
Public Attributes inherited from Aspose::Email::AttachmentBase | |
bool | Disposed |
Is disposed. More... | |
int32_t | TnefAttachIndex |
Protected Member Functions | |
System::String | GenerateContentId () override |
Generates the content id value. More... | |
virtual | ~Attachment () |
Protected Member Functions inherited from Aspose::Email::AttachmentBase | |
AttachmentBase () | |
Initializes a new instance of the AttachmentBase class. More... | |
AttachmentBase (System::SharedPtr< System::IO::Stream > contentStream, System::String name, System::String mediaType) | |
Initializes a new instance of the AttachmentBase class. More... | |
AttachmentBase (System::String fileName) | |
Initializes a new instance of the AttachmentBase class. More... | |
AttachmentBase (System::String fileName, System::String mediaType) | |
Initializes a new instance of the AttachmentBase class. More... | |
AttachmentBase (System::String fileName, System::SharedPtr< Aspose::Email::Mime::ContentType > contentType) | |
Initializes a new instance of the AttachmentBase class. More... | |
AttachmentBase (System::SharedPtr< System::IO::Stream > contentStream) | |
Initializes a new instance of the AttachmentBase class. More... | |
AttachmentBase (System::SharedPtr< System::IO::Stream > contentStream, System::String mediaType) | |
Initializes a new instance of the AttachmentBase class. More... | |
AttachmentBase (System::SharedPtr< System::IO::Stream > contentStream, System::SharedPtr< Aspose::Email::Mime::ContentType > contentType) | |
Initializes a new instance of the AttachmentBase class. More... | |
virtual void | Dispose (bool disposing) |
Releases unmanaged and - optionally - managed resources. More... | |
virtual | ~AttachmentBase () |
Protected Attributes | |
bool | isUri |
Additional Inherited Members | |
Static Protected Member Functions inherited from Aspose::Email::AttachmentBase | |
static System::SharedPtr< System::Text::Encoding > | GetEncodingFromContent (System::String contentString, System::SharedPtr< Aspose::Email::Mime::ContentType > contentType) |
Defines Encoding from content. More... | |
Represents an e-mail attachment.
The following example shows how to add and remove an Attachment from MailMessage.
[C#]
[Visual Basic]
Aspose::Email::Attachment::Attachment | ( | System::String | fileName | ) |
Initializes a new instance of the Attachment class.
/[ResourceExposure(ResourceScope.Machine)] /[ResourceConsumption(ResourceScope.Machine)]
fileName | Name of the file. |
Aspose::Email::Attachment::Attachment | ( | System::String | fileName, |
System::String | mediaType | ||
) |
Initializes a new instance of the Attachment class.
/[ResourceExposure(ResourceScope.Machine)] /[ResourceConsumption(ResourceScope.Machine)]
fileName | Name of the file. |
mediaType | Type media type name. |
Aspose::Email::Attachment::Attachment | ( | System::String | fileName, |
System::SharedPtr< Aspose::Email::Mime::ContentType > | contentType | ||
) |
Initializes a new instance of the Attachment class.
/[ResourceExposure(ResourceScope.Machine)] /[ResourceConsumption(ResourceScope.Machine)]
fileName | Name of the file. |
contentType | The ContentType. |
Aspose::Email::Attachment::Attachment | ( | System::SharedPtr< System::IO::Stream > | contentStream, |
System::String | name | ||
) |
Initializes a new instance of the Attachment class.
contentStream | The content stream of attachment. |
name | The attachment name. |
Aspose::Email::Attachment::Attachment | ( | System::SharedPtr< System::IO::Stream > | contentStream, |
System::String | name, | ||
System::String | mediaType | ||
) |
Initializes a new instance of the Attachment class.
contentStream | The content stream of attachment. |
name | The attachment name. |
mediaType | The media type name. |
Aspose::Email::Attachment::Attachment | ( | System::SharedPtr< System::IO::Stream > | contentStream, |
System::SharedPtr< Aspose::Email::Mime::ContentType > | contentType | ||
) |
Initializes a new instance of the Attachment class.
contentStream | The content stream of attachment. |
contentType | The ContentType. |
Aspose::Email::Attachment::Attachment | ( | ) |
Aspose::Email::Attachment::Attachment | ( | System::SharedPtr< System::IO::MemoryStream > | content, |
System::SharedPtr< Aspose::Email::Mime::ContentType > | contentType, | ||
System::String | name, | ||
System::String | contentLocation, | ||
System::String | contentId | ||
) |
Aspose::Email::Attachment::Attachment | ( | System::SharedPtr< Aspose::Email::Mime::MimePart > | part | ) |
Initializes a new instance of the Attachment class.
part | An attachment mime part |
ArgumentNullException | part is null |
|
protectedvirtual |
System::SharedPtr<Attachment> Aspose::Email::Attachment::Clone | ( | ) |
|
overridevirtual |
Implements Aspose::Email::AttachmentBase.
Reimplemented in Aspose::Email::ReferenceAttachment.
|
static |
Creates the attachment from string.
content | A string that represents the content of attachment. |
contentType | The ContentType. |
|
static |
Creates the attachment from string.
content | A string that represents the content of attachment. |
name | The attachment name. |
|
static |
Creates the attachment from string.
content | A string that represents the content of attachment. |
name | The attachment name. |
contentEncoding | The content encoding. |
mediaType | The media type name |
System::String Aspose::Email::Attachment::CreateName | ( | int32_t | attachmentNumber | ) |
|
overrideprotectedvirtual |
System::SharedPtr<Aspose::Email::Mime::ContentDisposition> Aspose::Email::Attachment::get_ContentDisposition | ( | ) |
Gets Content-Disposition header
System::String Aspose::Email::Attachment::get_CreatedName | ( | ) | const |
Created name from subject in case when attacment is message/rfc822
System::SharedPtr<ObjectIdentifier> Aspose::Email::Attachment::get_Id | ( | ) | const |
Object identifier
bool Aspose::Email::Attachment::get_IsEmbeddedMessage | ( | ) |
Gets a value indicating whether the attachment is an embedded message.
bool Aspose::Email::Attachment::get_IsTnef | ( | ) |
Gets a value indicating whether the attachment is TNEF formatted message.
bool Aspose::Email::Attachment::get_IsUri | ( | ) | const |
Gets a value indicating whether attachment is URI-attachment.
System::String Aspose::Email::Attachment::get_Name | ( | ) |
Gets an attachment name
System::SharedPtr<System::Text::Encoding> Aspose::Email::Attachment::get_NameEncoding | ( | ) |
Gets an encoding of attachment name
|
overridevirtual |
Gets a preferred text encoding
Implements Aspose::Email::IPreferredTextEncodingProvider.
void Aspose::Email::Attachment::set_CreatedName | ( | System::String | value | ) |
Created name from subject in case when attacment is message/rfc822
void Aspose::Email::Attachment::set_Name | ( | System::String | value | ) |
Sets an attachment name
void Aspose::Email::Attachment::set_NameEncoding | ( | System::SharedPtr< System::Text::Encoding > | value | ) |
Sets an encoding of attachment name
|
overridevirtual |
Sets a preferred text encoding
Implements Aspose::Email::IPreferredTextEncodingProvider.
System::SharedPtr<Calendar::Model::Property::AttachmentProperty> Aspose::Email::Attachment::ToCalendarAttachmentProperty | ( | ) |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
int32_t Aspose::Email::Attachment::CollectionNum |
|
protected |