
| 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 | |
| Visual Basic | Copy 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); | |
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:
- The message is an plain RFC822 (non-MIME) message.
- 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.
System.Object
Dart.PowerTCP.Mail.NonMime
Target Platforms: Microsoft .NET Framework 2.0