PowerTCP Mail for .NET
Text Property
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > NonMime Class : Text Property




Gets or sets the non-MIME text.

Syntax

Visual Basic (Declaration) 
Public Property Text As String
Visual Basic (Usage)Copy Code
Dim instance As NonMime
Dim value As String
 
instance.Text = value
 
value = instance.Text
C# 
public string Text {get; set;}
Managed Extensions for C++ 
public: __property string* get_Text();
public: __property void set_Text( 
   string* value
);
C++/CLI 
public:
property String^ Text {
   String^ get();
   void set (    String^ value);
}

Property Value

A string representing the non-MIME text of the message, or an empty string if no non-MIME text exits.

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

If you wish to create a MessageStream object representing a plain RFC822 message with text, you must use this property. In addition, this property is useful to set if you are creating a MIME message but would like to include a non-MIME part for browsers that cannot read MIME.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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