PowerTCP Mail for .NET
NonMime Class
Members  Example  See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace : NonMime Class




Contains all non-MIME parts of a message.

Object Model

NonMime ClassAttachmentStreams ClassAttachmentStream Class

Syntax

Visual Basic (Declaration) 
Public Class NonMime 
Visual Basic (Usage)Copy Code
Dim instance As NonMime
C# 
public class NonMime 
Managed Extensions for C++ 
public __gc class NonMime 
C++/CLI 
public ref class NonMime 

Example

The following example demonstrates creating a basic non-MIME message with a single attachment.
Visual BasicCopy Code
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Mail"
' at the top of your class.

' Create a MessageStream object
Dim msg As New MessageStream()

' Add a normal recipient
msg.To.Add(New MailAddress("you@test.com"))

' Specify the sender
msg.From = New MailAddress("me@test.com")

' Specify the subject
msg.Subject = "Test"

' Add Non-MIME text
msg.NonMime.Text = "Hello. How are you"

' Add a Non-MIME, Uuencoded attachment.
msg.NonMime.Attachments.Add(New AttachmentStream("C:\\files\\graph.jpg"))

' Specify the server
Smtp1.Server = "mail.test.com"

' Send the message
Smtp1.Send(msg)
C#Copy Code
// Be sure to import the namespace by putting "using Dart.PowerTCP.Mail;"
// at the top of your class.

// Create a MessageStream object
MessageStream msg = new MessageStream();

// Add a normal recipient
msg.To.Add(new MailAddress("you@test.com"));

// Specify the sender
msg.From = new MailAddress("me@test.com");

// Specify the subject
msg.Subject = "Test";

// Add Non-MIME text
msg.NonMime.Text = "Hello. How are you";

// Add a Non-MIME, Uuencoded attachment.
msg.NonMime.Attachments.Add(new AttachmentStream("C:\\files\\graph.jpg"));

// Specify the server
smtp1.Server = "mail.test.com";

// Send the message
smtp1.Send(msg);

Remarks

Messages could have two different types of parts, MIME and non-MIME. Any MIME parts are located in MessageStream.Parts, an instance of the Parts class. Any non-MIME parts are located in MessageStream.NonMime, an instance of the non-MIME class. MessageStream.NonMime will have content under one of two circumstances:

  1. The message is an plain RFC822 (non-MIME) message.
  2. The message is a MIME message containing non-MIME parts.

In the latter case, this often occurs with text that appears before the first MIME part that is intended to be read by non-MIME browsers. Also, a message could contain MIME parts along with a non-MIME attachment, again appearing before any MIME parts.

If you wish to create a MessageStream object representing a plain RFC822 message, you must do so by using MessageStream.NonMime.Text and MessageStream.NonMime.Attachments. Setting MessageStream.Text or MessageStream.Attachments creates a MIME message.

If you are getting messages that have any non-Mime attachments, they would be accessible either in MessageStream.NonMime.Attachments or MessageStream.Attachments.

MIME parts are accessible through MessageStream.Parts.

Inheritance Hierarchy

System.Object
   Dart.PowerTCP.Mail.NonMime

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.