SmtpMail.MimeParts Property


Gets the MimePartCollection of the e-mail message.

[Visual Basic]
Public Property MimeParts As MimePartCollection
[C#]
public MimePartCollection MimeParts {get;}
[C++]
public: __property MimePartCollection^ get_MimeParts();
[JScript]
public function get MimeParts() : MimePartCollection;

Property Value

Gets a MimePartCollection instance of the e-mail message.

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" ?>...