Discuss this help topic in SecureBlackbox Forum

TElMessage.AttachData

TElMessage     See also     


Filter: C#  VB.NET  Pascal  C++  PHP  Java  


Attaches some data to the message.

Declaration

[C#]
    TElMessagePart AttachData(string ContentType, string FileName, System.IO.Stream Stream, int DataSize, bool bMakeCopy);
    TElMessagePart AttachData(string ContentType, string FileName, string wsData);
    TElMessagePart AttachData(string ContentType, string FileName, byte[] Buffer, int Offset, int Count);

[VB.NET]
    Function AttachData(ByVal ContentType As String, ByVal FileName As String, ByVal Stream As System.IO.Stream, ByVal DataSize As Integer, ByVal bMakeCopy As Boolean) As TElMessagePart
    Function AttachData(ByVal ContentType As String, ByVal FileName As String, ByVal wsData As String) As TElMessagePart
    Function AttachData(ByVal ContentType As String, ByVal FileName As String, ByVal Buffer As Byte(), ByVal Offset As Integer, ByVal Count As Integer) As TElMessagePart

[Pascal]
    function AttachData(const ContentType, FileName: TString; Stream: TElNativeStream; DataSize: Integer = MaxInt; bMakeCopy: Boolean = False): TElMessagePart;
    function AttachData(const ContentType, FileName, wsData: TString): TElMessagePart;
    function AttachData(const ContentType, FileName: TString; const Buffer :TBytes; Offset, Count: Integer): TElMessagePart;

[C++]
    TElMessagePartHandle AttachData(const sb_u16string &ContentType, const sb_u16string &FileName, TStream &Stream, int32_t DataSize, bool bMakeCopy);
    TElMessagePartHandle AttachData(const sb_u16string &ContentType, const sb_u16string &FileName, TStream *Stream, int32_t DataSize, bool bMakeCopy);
    TElMessagePartHandle AttachData(const std::wstring &ContentType, const std::wstring &FileName, TStream &Stream, int32_t DataSize, bool bMakeCopy);
    TElMessagePartHandle AttachData(const std::wstring &ContentType, const std::wstring &FileName, TStream *Stream, int32_t DataSize, bool bMakeCopy);
    TElMessagePartHandle AttachData(const sb_u16string &ContentType, const sb_u16string &FileName, const sb_u16string &wsData);
    TElMessagePartHandle AttachData(const std::wstring &ContentType, const std::wstring &FileName, const std::wstring &wsData);
    TElMessagePartHandle AttachData(const sb_u16string &ContentType, const sb_u16string &FileName, const std::vector<uint8_t> &Buffer, int32_t Offset, int32_t Count);
    TElMessagePartHandle AttachData(const std::wstring &ContentType, const std::wstring &FileName, const std::vector<uint8_t> &Buffer, int32_t Offset, int32_t Count);

[PHP]
    TElMessagePart AttachData(string $ContentType, string $FileName, TStream $Stream, integer $DataSize, bool $bMakeCopy)
    TElMessagePart AttachData(string $ContentType, string $FileName, string $wsData)
    TElMessagePart AttachData(string $ContentType, string $FileName, array of byte|string|NULL $Buffer, integer $Offset, integer $Count)

[Java]
    TElMessagePart attachData(String ContentType, String FileName, String wsData);
    TElMessagePart attachData(String ContentType, String FileName, TElStream Stream, int DataSize, boolean bMakeCopy);
    TElMessagePart attachData(String ContentType, String FileName, byte[] Buffer, int Offset, int Count);

Parameters

  • ContentType - type of the attachment in "type/subtype" format.
  • FileName - specifies the name of the file that will contain the attachment.
  • Stream - the stream from which the data must be read.
  • DataSize - size of the data must be read from Stream in bytes.
  • bMakeCopy - defines if the data is copied from the stream immediately:
    True - the data will be copied;
    False - the data will be cached and then loaded when it is necessary.
    Default value is false.
  • wsData - the string from which data must be read.
  • Buffer - the buffer from which data must be read.
  • Count - size of data must be read from the Buffer in bytes.
  • Offset - starting offset in the buffer.

Description

    Use this method when you need to attach some data to your message. You can take data from the stream, string or buffer. If you use stream or buffer you can either make copy of the data or cache it and then load when it is necessary.
    Whichever type of data source you use contents will be attached to the message as a file. Use FileName parameter to specify its name.

See also:     AttachFile    

Discuss this help topic in SecureBlackbox Forum