diff --git a/FAQ.md b/FAQ.md index 118277a5a9..5f91370239 100644 --- a/FAQ.md +++ b/FAQ.md @@ -57,7 +57,7 @@ then add MIME parts to it that contain the content of the files you'd like to at the `Content-Disposition` header value to attachment. You'll probably also want to set the `filename` parameter on the `Content-Disposition` header as well as the `name` parameter on the `Content-Type` header. The most convenient way to do this is to use the -[MimePart.FileName](http://www.mimekit.net/docs/html/P_MimeKit_MimePart_FileName.htm) property which +[MimePart.FileName](https://www.mimekit.net/docs/html/P_MimeKit_MimePart_FileName.htm) property which will set both parameters for you as well as setting the `Content-Disposition` header value to `attachment` if it has not already been set to something else. @@ -99,7 +99,7 @@ message.Body = multipart; ``` A simpler way to construct messages with attachments is to take advantage of the -[BodyBuilder](http://www.mimekit.net/docs/html/T_MimeKit_BodyBuilder.htm) class. +[BodyBuilder](https://www.mimekit.net/docs/html/T_MimeKit_BodyBuilder.htm) class. ```csharp var message = new MimeMessage (); @@ -127,7 +127,7 @@ builder.Attachments.Add (@"C:\Users\Joey\Documents\party.ics"); message.Body = builder.ToMessageBody (); ``` -For more information, see [Creating Messages](http://www.mimekit.net/docs/html/Creating-Messages.htm). +For more information, see [Creating Messages](https://www.mimekit.net/docs/html/Creating-Messages.htm). ### Q: How do I get the main body of a message? @@ -196,15 +196,15 @@ There are a few common message structures: Now, if you don't care about any of that and just want to get the text of the first `text/plain` or `text/html` part you can find, that's easy. -[MimeMessage](http://www.mimekit.net/docs/html/T_MimeKit_MimeMessage.htm) has two convenience properties -for this: [TextBody](http://www.mimekit.net/docs/html/P_MimeKit_MimeMessage_TextBody.htm) and -[HtmlBody](http://www.mimekit.net/docs/html/P_MimeKit_MimeMessage_HtmlBody.htm). +[MimeMessage](https://www.mimekit.net/docs/html/T_MimeKit_MimeMessage.htm) has two convenience properties +for this: [TextBody](https://www.mimekit.net/docs/html/P_MimeKit_MimeMessage_TextBody.htm) and +[HtmlBody](https://www.mimekit.net/docs/html/P_MimeKit_MimeMessage_HtmlBody.htm). `MimeMessage.HtmlBody`, as the name implies, will traverse the MIME structure for you and find the most appropriate body part with a `Content-Type` of `text/html` that can be interpreted as the message body. Likewise, the `TextBody` property can be used to get the `text/plain` version of the message body. -For more information, see [Working with Messages](http://www.mimekit.net/docs/html/Working-With-Messages.htm). +For more information, see [Working with Messages](https://www.mimekit.net/docs/html/Working-With-Messages.htm). ### Q: How do I tell if a message has attachments? @@ -214,7 +214,7 @@ typically the textual body of the message, but it is not always quite that simpl In general, MIME attachments will have a `Content-Disposition` header with a value of `attachment`. To get the list of body parts matching this criteria, you can use the -[MimeMessage.Attachments](http://www.mimekit.net/docs/html/P_MimeKit_MimeMessage_Attachments.htm) property. +[MimeMessage.Attachments](https://www.mimekit.net/docs/html/P_MimeKit_MimeMessage_Attachments.htm) property. Unfortunately, not all mail clients follow this convention and so you may need to write your own custom logic. For example, you may wish to treat all body parts having a `name` or `filename` parameter set on them: @@ -501,8 +501,8 @@ property. The MimeKit API was designed to use the existing MIME format for serialization. In light of this, the ability to use the .NET serialization API and format did not make much sense to support. -You can easily serialize a [MimeMessage](http://www.mimekit.net/docs/html/T_MimeKit_MimeMessage.htm) to a stream using the -[WriteTo](http://www.mimekit.net/docs/html/Overload_MimeKit_MimeMessage_WriteTo.htm) methods. +You can easily serialize a [MimeMessage](https://www.mimekit.net/docs/html/T_MimeKit_MimeMessage.htm) to a stream using the +[WriteTo](https://www.mimekit.net/docs/html/Overload_MimeKit_MimeMessage_WriteTo.htm) methods. For more information on this topic, see the following other two topics: @@ -514,7 +514,7 @@ For more information on this topic, see the following other two topics: One of the more common operations that MimeKit is meant for is parsing email messages from arbitrary streams. There are two ways of accomplishing this task. -The first way is to use one of the [Load](http://www.mimekit.net/docs/html/Overload_MimeKit_MimeMessage_Load.htm) methods +The first way is to use one of the [Load](https://www.mimekit.net/docs/html/Overload_MimeKit_MimeMessage_Load.htm) methods on `MimeMessage`: ```csharp @@ -529,7 +529,7 @@ Or you can load a message from a file path: var message = MimeMessage.Load ("message.eml"); ``` -The second way is to use the [MimeParser](http://www.mimekit.net/docs/html/T_MimeKit_MimeParser.htm) class. For the most +The second way is to use the [MimeParser](https://www.mimekit.net/docs/html/T_MimeKit_MimeParser.htm) class. For the most part, using the `MimeParser` directly is not necessary unless you wish to parse a Unix mbox file stream. However, this is how you would do it: @@ -553,8 +553,8 @@ while (!parser.IsEndOfStream) { ### Q: How do I save messages? -One you've got a [MimeMessage](http://www.mimekit.net/docs/html/T_MimeKit_MimeMessage.htm), you can save -it to a file using the [WriteTo](http://mimekit.net/docs/html/Overload_MimeKit_MimeMessage_WriteTo.htm) method: +One you've got a [MimeMessage](https://www.mimekit.net/docs/html/T_MimeKit_MimeMessage.htm), you can save +it to a file using the [WriteTo](https://mimekit.net/docs/html/Overload_MimeKit_MimeMessage_WriteTo.htm) method: ```csharp message.WriteTo ("message.eml"); @@ -564,7 +564,7 @@ The `WriteTo` method also has overloads that allow you to write the message to a By default, the `WriteTo` method will save the message using DOS line-endings on Windows and Unix line-endings on Unix-based systems such as macOS and Linux. You can override this behavior by -passing a [FormatOptions](http://mimekit.net/docs/html/T_MimeKit_FormatOptions.htm) argument to +passing a [FormatOptions](https://mimekit.net/docs/html/T_MimeKit_FormatOptions.htm) argument to the method: ```csharp @@ -585,7 +585,7 @@ single charset to do the conversion (which is *exactly* what `ToString` does). ### Q: How do I save attachments? -If you've already got a [MimePart](http://www.mimekit.net/docs/html/T_MimeKit_MimePart.htm) that represents +If you've already got a [MimePart](https://www.mimekit.net/docs/html/T_MimeKit_MimePart.htm) that represents the attachment that you'd like to save, here's how you might save it: ```csharp @@ -595,7 +595,7 @@ using (var stream = File.Create (fileName)) Pretty simple, right? -But what if your attachment is actually a [MessagePart](http://www.mimekit.net/docs/html/T_MimeKit_MessagePart.htm)? +But what if your attachment is actually a [MessagePart](https://www.mimekit.net/docs/html/T_MimeKit_MessagePart.htm)? To save the content of a `message/rfc822` part, you'd use the following code snippet: @@ -626,26 +626,26 @@ foreach (var attachment in message.Attachments) { ### Q: How do I get the email addresses in the From, To, and Cc headers? -The [From](http://www.mimekit.net/docs/html/P_MimeKit_MimeMessage_From.htm), -[To](http://www.mimekit.net/docs/html/P_MimeKit_MimeMessage_To.htm), and -[Cc](http://www.mimekit.net/docs/html/P_MimeKit_MimeMessage_Cc.htm) properties of a -[MimeMessage](http://www.mimekit.net/docs/html/T_MimeKit_MimeMessage.htm) are all of type -[InternetAddressList](http://www.mimekit.net/docs/html/T_MimeKit_InternetAddressList.htm). An +The [From](https://www.mimekit.net/docs/html/P_MimeKit_MimeMessage_From.htm), +[To](https://www.mimekit.net/docs/html/P_MimeKit_MimeMessage_To.htm), and +[Cc](https://www.mimekit.net/docs/html/P_MimeKit_MimeMessage_Cc.htm) properties of a +[MimeMessage](https://www.mimekit.net/docs/html/T_MimeKit_MimeMessage.htm) are all of type +[InternetAddressList](https://www.mimekit.net/docs/html/T_MimeKit_InternetAddressList.htm). An `InternetAddressList` is a list of -[InternetAddress](http://www.mimekit.net/docs/html/T_MimeKit_InternetAddress.htm) items. This is +[InternetAddress](https://www.mimekit.net/docs/html/T_MimeKit_InternetAddress.htm) items. This is where most people start to get lost because an `InternetAddress` is an abstract class that only -really has a [Name](http://www.mimekit.net/docs/html/P_MimeKit_InternetAddress_Name.htm) property. +really has a [Name](https://www.mimekit.net/docs/html/P_MimeKit_InternetAddress_Name.htm) property. As you've probably already discovered, the `Name` property contains the name of the person (if available), but what you want is his or her email address, not their name. To get the email address, you'll need to figure out what subclass of address each `InternetAddress` really is. There are 2 subclasses of `InternetAddress`: -[GroupAddress](http://www.mimekit.net/docs/html/T_MimeKit_GroupAddress.htm) and -[MailboxAddress](http://www.mimekit.net/docs/html/T_MimeKit_MailboxAddress.htm). +[GroupAddress](https://www.mimekit.net/docs/html/T_MimeKit_GroupAddress.htm) and +[MailboxAddress](https://www.mimekit.net/docs/html/T_MimeKit_MailboxAddress.htm). A `GroupAddress` is a named group of more `InternetAddress` items that are contained within the -[Members](http://www.mimekit.net/docs/html/P_MimeKit_GroupAddress_Members.htm) property. To get +[Members](https://www.mimekit.net/docs/html/P_MimeKit_GroupAddress_Members.htm) property. To get an idea of what a group address represents, consider the following examples: ``` @@ -666,7 +666,7 @@ To: undisclosed-recipients:; Most of the time, the `From`, `To`, and `Cc` headers will only contain mailbox addresses. As you will notice, a `MailboxAddress` has an -[Address](http://www.mimekit.net/docs/html/P_MimeKit_MailboxAddress_Address.htm) property which will +[Address](https://www.mimekit.net/docs/html/P_MimeKit_MailboxAddress_Address.htm) property which will contain the email address of the mailbox. In the following example, the `Address` property will contain the value `john@smith.com`: @@ -701,7 +701,7 @@ As of MimeKit v1.2.18, it is possible to configure MimeKit to use the rfc2047 en filenames in the following two ways: The first way is to set the encoding method on each individual -[Parameter](http://www.mimekit.net/docs/html/T_MimeKit_Parameter.htm): +[Parameter](https://www.mimekit.net/docs/html/T_MimeKit_Parameter.htm): ```csharp Parameter param; @@ -725,7 +725,7 @@ of the message rather than using the PGP/MIME format that MimeKit prefers. These messages often look something like this: -``` +```text Return-Path: Received: from [127.0.0.1] (hostname.example.com. [201.95.8.17]) by mx.google.com with ESMTPSA id l67sm26628445yha.8.2014.04.27.13.49.44 @@ -880,7 +880,7 @@ body (assuming it has an HTML body) while still including the embedded images? This gets a bit more complicated, but it's still doable... The first thing we'd need to do is implement our own -[MimeVisitor](http://www.mimekit.net/docs/html/T_MimeKit_MimeVisitor.htm) to handle this: +[MimeVisitor](https://www.mimekit.net/docs/html/T_MimeKit_MimeVisitor.htm) to handle this: ```csharp public class ReplyVisitor : MimeVisitor diff --git a/README.md b/README.md index 76517730d0..99b009babf 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ THE SOFTWARE. The easiest way to install MimeKit is via [NuGet](https://www.nuget.org/packages/MimeKit/). -In Visual Studio's [Package Manager Console](http://docs.nuget.org/docs/start-here/using-the-package-manager-console), +In Visual Studio's [Package Manager Console](https://docs.nuget.org/docs/start-here/using-the-package-manager-console), enter the following command: ```powershell @@ -179,7 +179,7 @@ Note: The **Release** build will generate the xml API documentation, but the **D One of the more common operations that MimeKit is meant for is parsing email messages from arbitrary streams. There are two ways of accomplishing this task. -The first way is to use one of the [Load](http://www.mimekit.net/docs/html/Overload_MimeKit_MimeMessage_Load.htm) methods +The first way is to use one of the [Load](https://www.mimekit.net/docs/html/Overload_MimeKit_MimeMessage_Load.htm) methods on `MimeMessage`: ```csharp @@ -194,7 +194,7 @@ Or you can load a message from a file path: var message = MimeMessage.Load ("message.eml"); ``` -The second way is to use the [MimeParser](http://www.mimekit.net/docs/html/T_MimeKit_MimeParser.htm) class. For the most +The second way is to use the [MimeParser](https://www.mimekit.net/docs/html/T_MimeKit_MimeParser.htm) class. For the most part, using the `MimeParser` directly is not necessary unless you wish to parse a Unix mbox file stream. However, this is how you would do it: @@ -876,7 +876,7 @@ DKIM signature headers. Once you've implemented a custom `IDkimPublicKeyLocator`, verifying signatures is fairly trivial. Most of the work needed will be in the `IDkimPublicKeyLocator` implementation. As an example of how to implement this interface, -here is one possible implementation using the [Heijden.DNS](http://www.nuget.org/packages/Heijden.Dns/) library: +here is one possible implementation using the [Heijden.DNS](https://www.nuget.org/packages/Heijden.Dns/) library: ```csharp using System; @@ -1030,7 +1030,7 @@ ARC, you must first validate that the existing message is authentictic and produ an ARC-Authentication-Results header containing the methods that you used to authenticate the message as well as their results. -The abstract [ArcSigner](http://www.mimekit.net/docs/html/T_MimeKit_Cryptography_ArcSigner.htm) +The abstract [ArcSigner](https://www.mimekit.net/docs/html/T_MimeKit_Cryptography_ArcSigner.htm) class provided by MimeKit will need to be subclassed before it can be used. An example subclass that provides 2 different implementations for generating the ARC-Authentication-Results header can be seen below: @@ -1211,7 +1211,7 @@ Console.WriteLine ("ARC results: {0}", results.Chain); The first thing you'll need to do is fork MimeKit to your own GitHub repository. For instructions on how to do that, see the section titled **Getting the Source Code**. -If you use [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/) or [MonoDevelop](http://monodevelop.com), +If you use [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/) or [MonoDevelop](https://monodevelop.com), all of the solution files are configured with the coding style used by MimeKit. If you use Visual Studio on Windows or some other editor, please try to maintain the existing coding style as best as you can. @@ -1238,7 +1238,7 @@ string. Please include the `Exception.StackTrace` as well. The `Message`, by its ## Documentation -API documentation can be found at [http://www.mimekit.net/docs](http://www.mimekit.net/docs). +API documentation can be found at [https://www.mimekit.net/docs](https://www.mimekit.net/docs). A copy of the XML-formatted API reference documentation is also included in the NuGet package. @@ -1246,6 +1246,6 @@ A copy of the XML-formatted API reference documentation is also included in the MimeKit is a [.NET Foundation](https://www.dotnetfoundation.org/projects) project. -This project has adopted the code of conduct defined by the [Contributor Covenant](http://contributor-covenant.org/) to clarify expected behavior in our community. For more information, see the [.NET Foundation Code of Conduct](http://www.dotnetfoundation.org/code-of-conduct). +This project has adopted the code of conduct defined by the [Contributor Covenant](https://contributor-covenant.org/) to clarify expected behavior in our community. For more information, see the [.NET Foundation Code of Conduct](https://www.dotnetfoundation.org/code-of-conduct). General .NET OSS discussions: [.NET Foundation forums](https://forums.dotnetfoundation.org)