Skip to content

Conversation

@gewarren
Copy link
Contributor

@gewarren gewarren commented Jan 1, 2026

Contributes to dotnet/docs#50592.

Also does other cleanup in the file. (So hide whitespace changes.)

@gewarren gewarren requested a review from a team as a code owner January 1, 2026 16:47
Copilot AI review requested due to automatic review settings January 1, 2026 16:47
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the documentation for the MailAddress class to clarify that consecutive dots in user names are only allowed in .NET 9 and earlier, and are no longer permitted starting in .NET 10. The changes also include general formatting improvements and modernization of the documentation style.

  • Moves the consecutive dots remark from the allowed elements section to both the allowed and unsupported sections with version-specific notes
  • Updates property references from older %2A format to cleaner inline link format
  • Removes redundant "## Remarks" and "## Examples" headers, improves whitespace and formatting consistency

`(non comment) unquoted display (non comment) name (non comment) <user@host>`
Although the <xref:System.Net.Mail.MailAddress> class accepts a mail address as valid, other mail servers may not accept the mail address.
Although the <xref:System.Net.Mail.MailAddress> class accepts a mail address as valid, other mail servers might not accept the mail address.
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the custom coding guidelines, use "might" instead of "may" to indicate possibility.

Copilot generated this review using guidance from repository custom instructions.
- Mixed quoted and unquoted display names. For example, `display "name" <user@host>`.
- Groups, as defined in RFC 2822 Section 3.4 published by the IETF.
- The obsolete user name formats of `"user"."name"@host`, `user."name"@host` or `"user".name@host`.
- .NET 10 and later versions only: Consecutive dots in the user name, for example, `user...name@host.com`.
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a period at the end of this list item to comply with the custom coding guideline that code comments should end with a period.

Copilot generated this review using guidance from repository custom instructions.
For more information on supported mail address formats, see <xref:System.Net.Mail.MailAddress>.
If `address` contains a display name, and `displayName` is not `null` and is not equal to <xref:System.String.Empty?displayProperty=nameWithType>, `displayName` overrides the value specified in `address`.
The <xref:System.Net.Mail.MailAddress.%23ctor> method does not check if the `displayName` parameter is valid. This method removes surrounding quotes not displayed by the <xref:System.Net.Mail.MailAddress.DisplayName> property. Quotes will be added before transmission, except where <xref:System.Text.Encoding.ASCII> or <xref:System.Text.Encoding.Unicode> is specified in the `displayNameEncoding` parameter. The encoding specified in the `displayNameEncoding` parameter will be applied to the <xref:System.Net.Mail.MailAddress.DisplayName> property before transmission <xref:System.Text.Encoding.ASCII> or <xref:System.Text.Encoding.Unicode> is specified in the `displayNameEncoding` parameter. <xref:System.Text.Encoding.UTF8> is the default encoding if none is specified.
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence is overly long and complex. Consider breaking it into multiple sentences to improve readability and follow the guideline to break up long sentences.

Copilot generated this review using guidance from repository custom instructions.
The <xref:System.Net.Mail.MailAddress> class is used by the <xref:System.Net.Mail.SmtpClient> and <xref:System.Net.Mail.MailMessage> classes to store address information for email messages.
A mail address is composed of a <xref:System.Net.Mail.MailAddress.User%2A> name, <xref:System.Net.Mail.MailAddress.Host%2A> name and optionally, a <xref:System.Net.Mail.MailAddress.DisplayName%2A>. The <xref:System.Net.Mail.MailAddress.DisplayName%2A> can contain non-ASCII characters if you encode them.
A mail address is composed of a [user name](xref:System.Net.Mail.MailAddress.User), [host name](xref:System.Net.Mail.MailAddress.Host) and optionally, a [display name](xref:System.Net.Mail.MailAddress.DisplayName). <xref:System.Net.Mail.MailAddress.DisplayName> can contain non-ASCII characters if you encode them.
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "The" at the start of the sentence to match the style of the previous sentence and maintain consistency.

Suggested change
A mail address is composed of a [user name](xref:System.Net.Mail.MailAddress.User), [host name](xref:System.Net.Mail.MailAddress.Host) and optionally, a [display name](xref:System.Net.Mail.MailAddress.DisplayName). <xref:System.Net.Mail.MailAddress.DisplayName> can contain non-ASCII characters if you encode them.
The mail address is composed of a [user name](xref:System.Net.Mail.MailAddress.User), [host name](xref:System.Net.Mail.MailAddress.Host), and an optional [display name](xref:System.Net.Mail.MailAddress.DisplayName). <xref:System.Net.Mail.MailAddress.DisplayName> can contain non-ASCII characters if you encode them.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant