Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions xml/ns-System.Net.Mail.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
<Namespace Name="System.Net.Mail">
<Attributes>
<Attribute FrameworkAlternate="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.Obsolete("SmtpClient and its network of types are poorly designed, we strongly recommend you use https://github.com/jstedfast/MailKit and https://github.com/jstedfast/MimeKit instead")</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>The <see cref="N:System.Net.Mail" /> namespace contains classes used to send electronic mail to a Simple Mail Transfer Protocol (SMTP) server for delivery.</summary>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
The <xref:System.Net.Mail.MailMessage> class represents the content of a mail message. The <xref:System.Net.Mail.SmtpClient> class transmits email to the SMTP host that you designate for mail delivery. You can create mail attachments using the <xref:System.Net.Mail.Attachment> class.

Choose a reason for hiding this comment

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

Suggested change
The <xref:System.Net.Mail.MailMessage> class represents the content of a mail message. The <xref:System.Net.Mail.SmtpClient> class transmits email to the SMTP host that you designate for mail delivery. You can create mail attachments using the <xref:System.Net.Mail.Attachment> class.
The <xref:System.Net.Mail.MailMessage> class represents the content of a mail message.
You can create mail attachments using the <xref:System.Net.Mail.Attachment> class.



[!IMPORTANT]
We don't recommend that you use the `SmtpClient` class for new development. For more information, see [SmtpClient shouldn't be used](https://github.com/dotnet/platform-compat/blob/master/docs/DE0005.md) on GitHub.

Choose a reason for hiding this comment

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

The formatting here is incorrect to produce a note box. The lines should be preceded by > . But this seems an awkward way of handling the fact that SmtpClient is obsolete in any case. Instead of the note, I'd modify the Remarks section as I've suggested, and also add "(This type is now obsolete.)" to the type summary in dotnet-api-docs/xml/System.Net.Mail/SmtpClient.xml.


]]></format>
</remarks>
<altmember cref="N:System.Net" />
Expand All @@ -20,4 +28,4 @@
<related type="Article" href="~/docs/framework/network-programming/network-tracing.md">Network Tracing in the .NET Framework</related>
<related type="Article" href="~/docs/framework/network-programming/security-in-network-programming.md">Security in Network Programming</related>
</Docs>
</Namespace>
</Namespace>