Base class for mail attachment. More...

Inherits IDisposable.

Inherited by Aspose::Email::AlternateView, Aspose::Email::Attachment, and Aspose::Email::LinkedResource.

Public Member Functions

ASPOSE_EMAIL_SHARED_API System::SharedPtr< System::IO::Stream > get_ContentStream ()
 Gets the content stream. More...
 
ASPOSE_EMAIL_SHARED_API void set_ContentStream (System::SharedPtr< System::IO::Stream > value)
 Sets the content stream. More...
 
ASPOSE_EMAIL_SHARED_API System::String get_ContentId ()
 Gets the content id. More...
 
ASPOSE_EMAIL_SHARED_API void set_ContentId (System::String value)
 Sets the content id. More...
 
virtual ASPOSE_EMAIL_SHARED_API System::SharedPtr< Mime::HeaderCollectionget_Headers ()
 Gets headers collection of attachment. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< Aspose::Email::Mime::ContentTypeget_ContentType ()
 Gets the type of the content. More...
 
ASPOSE_EMAIL_SHARED_API void set_ContentType (System::SharedPtr< Aspose::Email::Mime::ContentType > value)
 Sets the type of the content. More...
 
ASPOSE_EMAIL_SHARED_API Aspose::Email::Mime::TransferEncoding get_TransferEncoding ()
 Gets the transfer encoding. More...
 
ASPOSE_EMAIL_SHARED_API void set_TransferEncoding (Aspose::Email::Mime::TransferEncoding value)
 Sets the transfer encoding. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< System::Uri > get_ContentLocation () const
 Gets the content location. More...
 
ASPOSE_EMAIL_SHARED_API void set_ContentLocation (System::SharedPtr< System::Uri > value)
 Sets the content location. More...
 
ASPOSE_EMAIL_SHARED_API System::SharedPtr< Aspose::Email::Mime::MimePart > get_MimePart () const
 Gets the MIME part. More...
 
ASPOSE_EMAIL_SHARED_API void set_MimePart (System::SharedPtr< Aspose::Email::Mime::MimePart > value)
 Sets the MIME part. More...
 
ASPOSE_EMAIL_SHARED_API bool get_Hidden () const
 
ASPOSE_EMAIL_SHARED_API void set_Hidden (bool value)
 
ASPOSE_EMAIL_SHARED_API AttachmentBase (System::SharedPtr< Aspose::Email::Mime::MimePart > part)
 Initializes a new instance of the AttachmentBase class. More...
 
virtual ASPOSE_EMAIL_SHARED_API void Save (System::SharedPtr< System::IO::Stream > stream)
 Saves the specified stream. More...
 
virtual ASPOSE_EMAIL_SHARED_API void SaveInternal (System::SharedPtr< System::IO::Stream > stream)
 Saves the specified stream. More...
 
virtual ASPOSE_EMAIL_SHARED_API void Save (System::String fileName)
 Saves the specified file name. More...
 
ASPOSE_EMAIL_SHARED_API void Dispose ()
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. More...
 
ASPOSE_EMAIL_SHARED_API void SetContentFromString (System::String contentString, System::SharedPtr< Aspose::Email::Mime::ContentType > contentType)
 Sets the content from string. More...
 
ASPOSE_EMAIL_SHARED_API void SetContentFromString (System::String contentString, System::SharedPtr< System::Text::Encoding > encoding, System::String mediaType)
 Sets the content from string. More...
 
ASPOSE_EMAIL_SHARED_API void SetSTnefContent (System::ArrayPtr< uint8_t > data)
 Sets the S/TNEF content. More...
 
virtual ASPOSE_EMAIL_SHARED_API void PrepareForSending ()
 Prepares for sending. More...
 
virtual ASPOSE_EMAIL_SHARED_API System::SharedPtr< Mapi::MapiAttachmentConvertToMapiAttachment (Mapi::OutlookMessageFormat format, int32_t codePage, int32_t count, bool preserveDates)=0
 

Public Attributes

bool Disposed
 
System::SharedPtr< Aspose::Email::Mime::MimePart > part
 
int32_t TnefAttachIndex
 

Protected Member Functions

ASPOSE_EMAIL_SHARED_API AttachmentBase ()
 Initializes a new instance of the AttachmentBase class. More...
 
ASPOSE_EMAIL_SHARED_API AttachmentBase (System::SharedPtr< System::IO::Stream > contentStream, System::String name, System::String mediaType)
 Initializes a new instance of the AttachmentBase class. More...
 
ASPOSE_EMAIL_SHARED_API AttachmentBase (System::String fileName)
 Initializes a new instance of the AttachmentBase class. More...
 
ASPOSE_EMAIL_SHARED_API AttachmentBase (System::String fileName, System::String mediaType)
 Initializes a new instance of the AttachmentBase class. More...
 
ASPOSE_EMAIL_SHARED_API AttachmentBase (System::String fileName, System::SharedPtr< Aspose::Email::Mime::ContentType > contentType)
 Initializes a new instance of the AttachmentBase class. More...
 
ASPOSE_EMAIL_SHARED_API AttachmentBase (System::SharedPtr< System::IO::Stream > contentStream)
 Initializes a new instance of the AttachmentBase class. More...
 
ASPOSE_EMAIL_SHARED_API AttachmentBase (System::SharedPtr< System::IO::Stream > contentStream, System::String mediaType)
 Initializes a new instance of the AttachmentBase class. More...
 
ASPOSE_EMAIL_SHARED_API AttachmentBase (System::SharedPtr< System::IO::Stream > contentStream, System::SharedPtr< Aspose::Email::Mime::ContentType > contentType)
 Initializes a new instance of the AttachmentBase class. More...
 
virtual ASPOSE_EMAIL_SHARED_API System::String GenerateContentId ()
 Generates the content id value. More...
 
ASPOSE_EMAIL_SHARED_API 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...
 
virtual ASPOSE_EMAIL_SHARED_API void Dispose (bool disposing)
 Releases unmanaged and - optionally - managed resources. More...
 

Static Protected Member Functions

static ASPOSE_EMAIL_SHARED_API System::SharedPtr< System::Text::Encoding > GetEncodingFromContent (System::String contentString, System::SharedPtr< Aspose::Email::Mime::ContentType > contentType)
 Defines Encoding from content. More...
 

Friends

class Aspose::Email::MailMessage
 
class Aspose::Email::Clients::Exchange::WebService::EWSClient2007
 
class Aspose::Email::Common::ContactConverter
 
class Aspose::Email::Mapi::MailMessageInterpretor
 
class Aspose::Email::Mapi::OpaqueSignedMailMessageInterpretor
 
class Aspose::Email::Calendar::Appointment
 
class Aspose::Email::Mapi::MapiMessage
 
class Aspose::Email::Mapi::OutlookUtil
 
class Aspose::Email::Tnef::TnefAttachment
 
class Aspose::Email::AlternateView
 
class Aspose::Email::Attachment
 
class Aspose::Email::LinkedResource
 

Detailed Description

Base class for mail attachment.

Constructor & Destructor Documentation

◆ AttachmentBase() [1/9]

ASPOSE_EMAIL_SHARED_API Aspose::Email::AttachmentBase::AttachmentBase ( System::SharedPtr< Aspose::Email::Mime::MimePart >  part)

Initializes a new instance of the AttachmentBase class.

Parameters
partAn attachment mime part
Exceptions
ArgumentNullExceptionpart is null

◆ AttachmentBase() [2/9]

ASPOSE_EMAIL_SHARED_API Aspose::Email::AttachmentBase::AttachmentBase ( )
protected

Initializes a new instance of the AttachmentBase class.

◆ AttachmentBase() [3/9]

ASPOSE_EMAIL_SHARED_API Aspose::Email::AttachmentBase::AttachmentBase ( System::SharedPtr< System::IO::Stream >  contentStream,
System::String  name,
System::String  mediaType 
)
protected

Initializes a new instance of the AttachmentBase class.

Parameters
contentStreamThe content stream.
nameThe attachment name.
mediaTypeType of the media.

◆ AttachmentBase() [4/9]

ASPOSE_EMAIL_SHARED_API Aspose::Email::AttachmentBase::AttachmentBase ( System::String  fileName)
protected

Initializes a new instance of the AttachmentBase class.

Parameters
fileNameName of the file.

◆ AttachmentBase() [5/9]

ASPOSE_EMAIL_SHARED_API Aspose::Email::AttachmentBase::AttachmentBase ( System::String  fileName,
System::String  mediaType 
)
protected

Initializes a new instance of the AttachmentBase class.

Parameters
fileNameName of the file.
mediaTypeType of the media.

◆ AttachmentBase() [6/9]

ASPOSE_EMAIL_SHARED_API Aspose::Email::AttachmentBase::AttachmentBase ( System::String  fileName,
System::SharedPtr< Aspose::Email::Mime::ContentType contentType 
)
protected

Initializes a new instance of the AttachmentBase class.

Parameters
fileNameName of the file.
contentTypeType of the content.

◆ AttachmentBase() [7/9]

ASPOSE_EMAIL_SHARED_API Aspose::Email::AttachmentBase::AttachmentBase ( System::SharedPtr< System::IO::Stream >  contentStream)
protected

Initializes a new instance of the AttachmentBase class.

Parameters
contentStreamThe content stream.

◆ AttachmentBase() [8/9]

ASPOSE_EMAIL_SHARED_API Aspose::Email::AttachmentBase::AttachmentBase ( System::SharedPtr< System::IO::Stream >  contentStream,
System::String  mediaType 
)
protected

Initializes a new instance of the AttachmentBase class.

Parameters
contentStreamThe content stream.
mediaTypeType of the media.

◆ AttachmentBase() [9/9]

ASPOSE_EMAIL_SHARED_API Aspose::Email::AttachmentBase::AttachmentBase ( System::SharedPtr< System::IO::Stream >  contentStream,
System::SharedPtr< Aspose::Email::Mime::ContentType contentType 
)
protected

Initializes a new instance of the AttachmentBase class.

Parameters
contentStreamThe content stream.
contentTypeType of the content.

Member Function Documentation

◆ ConvertToMapiAttachment()

virtual ASPOSE_EMAIL_SHARED_API System::SharedPtr<Mapi::MapiAttachment> Aspose::Email::AttachmentBase::ConvertToMapiAttachment ( Mapi::OutlookMessageFormat  format,
int32_t  codePage,
int32_t  count,
bool  preserveDates 
)
pure virtual

◆ Dispose() [1/2]

ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::Dispose ( )

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

◆ Dispose() [2/2]

virtual ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::Dispose ( bool  disposing)
protectedvirtual

Releases unmanaged and - optionally - managed resources.

Parameters
disposingtrue to release both managed and unmanaged resources; false to release only unmanaged resources.

Reimplemented in Aspose::Email::AlternateView.

◆ GenerateContentId()

virtual ASPOSE_EMAIL_SHARED_API System::String Aspose::Email::AttachmentBase::GenerateContentId ( )
protectedvirtual

Generates the content id value.

Returns

Reimplemented in Aspose::Email::Attachment.

◆ get_ContentId()

ASPOSE_EMAIL_SHARED_API System::String Aspose::Email::AttachmentBase::get_ContentId ( )

Gets the content id.

The content id.

◆ get_ContentLocation()

ASPOSE_EMAIL_SHARED_API System::SharedPtr<System::Uri> Aspose::Email::AttachmentBase::get_ContentLocation ( ) const

Gets the content location.

The content location.

◆ get_ContentStream()

ASPOSE_EMAIL_SHARED_API System::SharedPtr<System::IO::Stream> Aspose::Email::AttachmentBase::get_ContentStream ( )

Gets the content stream.

The content stream.

◆ get_ContentType()

ASPOSE_EMAIL_SHARED_API System::SharedPtr<Aspose::Email::Mime::ContentType> Aspose::Email::AttachmentBase::get_ContentType ( )

Gets the type of the content.

The type of the content.

◆ get_Headers()

virtual ASPOSE_EMAIL_SHARED_API System::SharedPtr<Mime::HeaderCollection> Aspose::Email::AttachmentBase::get_Headers ( )
virtual

Gets headers collection of attachment.

◆ get_Hidden()

ASPOSE_EMAIL_SHARED_API bool Aspose::Email::AttachmentBase::get_Hidden ( ) const

◆ get_MimePart()

ASPOSE_EMAIL_SHARED_API System::SharedPtr<Aspose::Email::Mime::MimePart> Aspose::Email::AttachmentBase::get_MimePart ( ) const

Gets the MIME part.

The MIME part.

◆ get_TransferEncoding()

ASPOSE_EMAIL_SHARED_API Aspose::Email::Mime::TransferEncoding Aspose::Email::AttachmentBase::get_TransferEncoding ( )

Gets the transfer encoding.

The transfer encoding.

◆ GetEncodingFromContent()

static ASPOSE_EMAIL_SHARED_API System::SharedPtr<System::Text::Encoding> Aspose::Email::AttachmentBase::GetEncodingFromContent ( System::String  contentString,
System::SharedPtr< Aspose::Email::Mime::ContentType contentType 
)
staticprotected

Defines Encoding from content.

Parameters
contentStringThe content string.
contentTypeThe content type.
Returns
Defined encodingSystem::Text::Encoding.

◆ PrepareForSending()

virtual ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::PrepareForSending ( )
virtual

Prepares for sending.

◆ Save() [1/2]

virtual ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::Save ( System::SharedPtr< System::IO::Stream >  stream)
virtual

Saves the specified stream.

Parameters
streamThe stream.

◆ Save() [2/2]

virtual ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::Save ( System::String  fileName)
virtual

Saves the specified file name.

Parameters
fileNameName of the file.

◆ SaveInternal()

virtual ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::SaveInternal ( System::SharedPtr< System::IO::Stream >  stream)
virtual

Saves the specified stream.

Parameters
streamThe stream.

◆ set_ContentId()

ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::set_ContentId ( System::String  value)

Sets the content id.

The content id.

◆ set_ContentLocation()

ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::set_ContentLocation ( System::SharedPtr< System::Uri >  value)

Sets the content location.

The content location.

◆ set_ContentStream()

ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::set_ContentStream ( System::SharedPtr< System::IO::Stream >  value)

Sets the content stream.

The content stream.

◆ set_ContentType()

ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::set_ContentType ( System::SharedPtr< Aspose::Email::Mime::ContentType value)

Sets the type of the content.

The type of the content.

◆ set_Hidden()

ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::set_Hidden ( bool  value)

◆ set_MimePart()

ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::set_MimePart ( System::SharedPtr< Aspose::Email::Mime::MimePart >  value)

Sets the MIME part.

The MIME part.

◆ set_TransferEncoding()

ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::set_TransferEncoding ( Aspose::Email::Mime::TransferEncoding  value)

Sets the transfer encoding.

The transfer encoding.

◆ SetContentFromString() [1/3]

ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::SetContentFromString ( System::String  contentString,
System::SharedPtr< Aspose::Email::Mime::ContentType contentType 
)

Sets the content from string.

Parameters
contentStringThe content string.
contentTypeType of the content.

◆ SetContentFromString() [2/3]

ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::SetContentFromString ( System::String  contentString,
System::SharedPtr< System::Text::Encoding >  encoding,
System::SharedPtr< Aspose::Email::Mime::ContentType contentType,
Aspose::Email::Mime::TransferEncoding  te 
)
protected

Sets the content from string.

Parameters
contentStringThe content string.
encodingThe encoding.
contentTypeThe content type.
teThe transfer encoding.

◆ SetContentFromString() [3/3]

ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::SetContentFromString ( System::String  contentString,
System::SharedPtr< System::Text::Encoding >  encoding,
System::String  mediaType 
)

Sets the content from string.

Parameters
contentStringThe content string.
encodingThe encoding.
mediaTypeType of the media.

◆ SetSTnefContent()

ASPOSE_EMAIL_SHARED_API void Aspose::Email::AttachmentBase::SetSTnefContent ( System::ArrayPtr< uint8_t >  data)

Sets the S/TNEF content.

Parameters
dataThe thef data.

Friends And Related Function Documentation

◆ Aspose::Email::AlternateView

friend class Aspose::Email::AlternateView
friend

◆ Aspose::Email::Attachment

friend class Aspose::Email::Attachment
friend

◆ Aspose::Email::Calendar::Appointment

◆ Aspose::Email::Clients::Exchange::WebService::EWSClient2007

friend class Aspose::Email::Clients::Exchange::WebService::EWSClient2007
friend

◆ Aspose::Email::Common::ContactConverter

friend class Aspose::Email::Common::ContactConverter
friend

◆ Aspose::Email::LinkedResource

friend class Aspose::Email::LinkedResource
friend

◆ Aspose::Email::MailMessage

friend class Aspose::Email::MailMessage
friend

◆ Aspose::Email::Mapi::MailMessageInterpretor

friend class Aspose::Email::Mapi::MailMessageInterpretor
friend

◆ Aspose::Email::Mapi::MapiMessage

friend class Aspose::Email::Mapi::MapiMessage
friend

◆ Aspose::Email::Mapi::OpaqueSignedMailMessageInterpretor

friend class Aspose::Email::Mapi::OpaqueSignedMailMessageInterpretor
friend

◆ Aspose::Email::Mapi::OutlookUtil

friend class Aspose::Email::Mapi::OutlookUtil
friend

◆ Aspose::Email::Tnef::TnefAttachment

friend class Aspose::Email::Tnef::TnefAttachment
friend

Member Data Documentation

◆ Disposed

bool Aspose::Email::AttachmentBase::Disposed

◆ part

System::SharedPtr<Aspose::Email::Mime::MimePart> Aspose::Email::AttachmentBase::part

◆ TnefAttachIndex

int32_t Aspose::Email::AttachmentBase::TnefAttachIndex