| Visual Basic (Declaration) | |
|---|---|
Public Property Attachments As AttachmentStreams | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As NonMime Dim value As AttachmentStreams instance.Attachments = value value = instance.Attachments | |
| C# | |
|---|---|
public AttachmentStreams Attachments {get; set;} | |
| Managed Extensions for C++ | |
|---|---|
public: __property AttachmentStreams* get_Attachments(); public: __property void set_Attachments( AttachmentStreams* value ); | |
| C++/CLI | |
|---|---|
public: property AttachmentStreams^ Attachments { AttachmentStreams^ get(); void set ( AttachmentStreams^ value); } | |
Property Value
An AttachmentStreams collection containing any non-MIME attachments.The following example demonstrates creating a basic non-MIME message with a single attachment.
| 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); | |
The NonMime.Attachments collection contains all non-MIME attachments. These attachments can be Uuencoded or Yencoded, although attachments of this type are always Uuencoded when read out. Uuencoding is an encoding alternative to MIME and may be preferred when sending mail to non-MIME enabled clients.
Target Platforms: Microsoft .NET Framework 2.0
Copy Code