MimePartCollection Class


The collection of MimePart class.

System.Object
    System.Collections.Generic.IList<MimePart>
        EASendMail.MimePartCollection

[Visual Basic]
Public Class MimePartCollection
[C#]
public class MimePartCollection
[C++]
public ref class MimePartCollection
[JScript]
public class MimePartCollection

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Methods and Properties

Please refer to .NET Framework SDK System.Collections.IList<T>.

Remarks

MimePart and MimePartCollection are the base class for generating email message. We don't suggest that the developers use these classes directly. Anyway, the MimePart and MimePartCollection can be used to generate some special email message, see the following example code.

Example

[C# - Generate text/xml mime part]
SmtpMail oMail = new SmtpMail("TryIt");
MimePart oMimePart = new MimePart();
oMimePart.Charset = "utf-8";
oMimePart.Headers.Insert( 0, new HeaderItem( "Content-Type: text/xml;\r\n\tcharset=\"utf-8\"" ));
oMimePart.TransferEncoding = TransferEncodingType.EncodingQuotedPrintable;
oMimePart.UnencodeContent = System.Text.Encoding.UTF8.GetBytes( "<?xml version=\"1.0\" encoding=\"utf-8\" ?>..." );
oMail.MimeParts.Add( oMimePart );

await oMail.SaveAsAsync( "ms-appdata:///local/test.email", true );

' the following content will be generated.
Message-ID: <040a9d32e7846ef3323594400010770e@>
From: <>
Subject: (Trial Version)
Date: Tue, 21 Mar 2006 09:28:37 +0800
MIME-Version: 1.0
Content-Type: text/xml;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

<?xml version=3D"1.0" encoding=3D"utf-8" ?>...