| Visual Basic (Declaration) | |
|---|---|
Public Enum HeaderLabelType Inherits System.Enum | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As HeaderLabelType | |
| C# | |
|---|---|
public enum HeaderLabelType : System.Enum | |
| Managed Extensions for C++ | |
|---|---|
__value public enum HeaderLabelType : public System.Enum | |
| C++/CLI | |
|---|---|
public enum class HeaderLabelType : public System.Enum | |
| Member | Description |
|---|---|
| AlsoControl | "Also-Control:" |
| AlternateRecipient | "Alternate-Recipient:" |
| ApparentlyTo | "Apparently-To:" |
| Approved | "Approved:" |
| ArticleNames | "Article-Names:" |
| ArticleUpdates | "Article-Updates:" |
| AutoForwarded | "Auto-Forwarded:" |
| CC | "CC:" |
| Comments | "Comments:" |
| ContentBase | "Content-Base:" |
| ContentConversion | "Content-Conversion:" |
| ContentDescription | "Content-Description:" |
| ContentDisposition | "Content-Disposition:" |
| ContentID | "Content-ID:" |
| ContentIdentifier | "Content-Identifier:" |
| ContentLanguage | "Content-Language:" |
| ContentLength | "Content-Length:" |
| ContentLocation | "Content-Location:" |
| ContentMD5 | "Content-MD5:" |
| ContentReturn | "Content-Return:" |
| ContentSGMLEntity | "Content-SGML-Entity:" |
| ContentTransferEncoding | "Content-Transfer-Encoding:" |
| ContentType | "Content-Type:" |
| Control | "Control:" |
| Conversion | "Conversion:" |
| ConversionWithLoss | "Conversion-With-Loss:" |
| Date | "Date:" |
| DeliveryDate | "Delivery-Date:" |
| DeliveryReport | "Delivery-Report:" |
| DiscardedX400IPMSExtensions | "Discarded-X400-IPMS-Extensions:" |
| DiscardedX400MTSExtensions | "Discarded-X400-MTS-Extensions:" |
| DiscloseRecipients | "Disclose-Recipients:" |
| Distribution | "Distribution:" |
| DLExpansionHistoryIndication | "DL-Expansion-History-Indication:" |
| Encoding | "Encoding:" |
| ErrorsTo | "Errors-To:" |
| Expires | "Expires:" |
| Fax | "Fax:" |
| Fcc | "Fcc:" |
| FollowupTo | "Followup-To:" |
| ForComment | "For-Comment:" |
| ForHandling | "For-Handling:" |
| From | "From:" |
| GenerateDeliveryReport | "Generate-Delivery-Report:" |
| Importance | "Importance:" |
| IncompleteCopy | "Incomplete-Copy:" |
| InReplyTo | "In-Reply-To:" |
| Keywords | "Keywords:" |
| Language | "Language:" |
| Lines | "Lines:" |
| Mailer | "X-Mailer:" |
| MailSystemVersion | "Mail-System-Version:" |
| MessageID | "Message-ID" |
| MessageType | "Message-Type:" |
| MIMEVersion | "MIME-Version:" |
| Newsgroups | "Newsgroups:" |
| Obsoletes | "Obsoletes:" |
| Organisation | "Organisation:" |
| Organization | "Organization:" |
| OriginalEncodedInformationTypes | "Original-Encoded-Information-Types:" |
| OriginatingClient | "Originating-Client:" |
| Path | "Path:" |
| Phone | "Phone:" |
| Precedence | "Precedence:" |
| PreventNonDeliveryReport | "Prevent-NonDelivery-Report:" |
| Received | "Received:" |
| References | "References:" |
| ReplyBy | "Reply-By:" |
| ReplyTo | "Reply-To:" |
| ReturnPath | "Return-Path:" |
| ReturnReceiptTo | "Return-Receipt-To:" |
| SeeAlso | "See-Also:" |
| Sender | "Sender:" |
| Sensitivity | "Sensitivity:" |
| Status | "Status:" |
| Subject | "Subject:" |
| Summary | "Summary:" |
| Supersedes | "Supersedes:" |
| Telefax | "Telefax:" |
| To | "To:" |
| X400ContentReturn | "X400-Content-Return:" |
| XMailer | "X-Mailer:" |
| XNewsreader | "X-Newsreader:" |
| XPriority | "X-Priority:" |
| Xref | "Xref:" |
The following example demonstrates the many ways a MIME message can be created.
| Visual Basic | Copy Code |
|---|---|
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Mail" ' at the top of your class. In addition, import System.IO, as a FileStream will be used. ' 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 a MIME attachment msg.Parts.Attachments.Add(New MimeAttachmentStream("C:\files\graph.bmp")) ' Add some MIME text (Setting MessageStream.Text also does this). msg.Parts.Simple.Add(New MessagePartStream("More text here")) ' Create a complex MIME part from a stored message. msg.Parts.Complex.Add(New MessageStream(New FileStream("C:\\message.eml", FileMode.Open))) ' Create a custom MIME boundary to use. (the component will ' create a default MIME boundary to use if this isn't specified) msg.MimeBoundary = "----MyBoundary-----" ' Override automatic date setting msg.Date = "" ' Add a header line. msg.Header.Add(HeaderLabelType.Organization, "My Organization") ' Now add a custom header line. msg.Header.Add("X-My-Field: My Value") ' 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. In addition, import System.IO, as a FileStream will be used.\ // 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 a MIME attachment msg.Parts.Attachments.Add(new MimeAttachmentStream("C:\\files\\graph.bmp")); // Add some MIME text (MessageStream.Text also does this). msg.Parts.Simple.Add(new MessagePartStream("More text here")); // Create a complex MIME part from a stored message. msg.Parts.Complex.Add(new MessageStream(new FileStream("C:\\message.eml", FileMode.Open))); // Create a custom MIME boundary to use. (the component will // create a default MIME boundary to use if this isn't specified) msg.MimeBoundary = "----MyBoundary-----"; // Override automatic date setting msg.Date = ""; // Add a header line. msg.Header.Add(HeaderLabelType.Organization, "My Organization"); // Now add a custom header line. msg.Header.Add("X-My-Field: My Value"); // Specify the server smtp1.Server = "mail.test.com"; // Send the message smtp1.Send(msg); | |
To add a header line, simply use the MailHeader.Add method, specifying the header type and value. To add a header line not specified in this enumeration, use the MailHeader.Add method, specifying HeaderLabelType.UserDefined as the label, and your entire custom header line as the value.
System.Object
System.ValueType
System.Enum
Dart.PowerTCP.Mail.HeaderLabelType
Target Platforms: Microsoft .NET Framework 2.0