Skip to content

Conversation

stephenegriffin
Copy link
Contributor

Lift the warning from SmtpClient to the namespace to make it clearer this is now obsolete.

Summary

Describe your changes here.

Fixes #Issue_Number (if available)

Lift the warning from SmtpClient to the namespace to make it clearer this is now obsolete.
Copy link

@rpetrusha rpetrusha left a comment

Choose a reason for hiding this comment

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

Thanks for submitting this PR, @stephenegriffin. I don't think, though, that adding an IMPORTANT note really calls attention to the fact that SmtpClient is deprecated. I've suggested an alternative.



[!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.

<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.

@rpetrusha rpetrusha added this to the May 2019 milestone May 8, 2019
@rpetrusha
Copy link

Since you didn't respond, @stephenegriffin, I've incorporated my suggestions into your PR, and also opened #2483 to change the description of SmtpClient. I'll merge your PR now.

@rpetrusha rpetrusha merged commit a3099b7 into dotnet:master May 23, 2019
@stephenegriffin
Copy link
Contributor Author

Sorry - missed your reply - thanks for following through on this.

@stephenegriffin stephenegriffin deleted the patch-1 branch May 23, 2019 19:11
@stephenegriffin
Copy link
Contributor Author

Actually - this is all wrong - the point was to indicate that the entire System.Net.Mail namespace is deprecated. You've removed that and added a redundant note to SmtpClient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants