Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is System.Net.Mail.SmtpClient obsolete in 4.7.2 and 4.8 ? #4114

Closed
MatthieuHernandez opened this issue Apr 15, 2020 · 8 comments · Fixed by #7359
Closed

Is System.Net.Mail.SmtpClient obsolete in 4.7.2 and 4.8 ? #4114

MatthieuHernandez opened this issue Apr 15, 2020 · 8 comments · Fixed by #7359
Labels
area-System.Net Pri3 Indicates issues/PRs that are low priority

Comments

@MatthieuHernandez
Copy link

I can't see any trace of System.Obsolete inside the code of SmtpClient.cs. Does this mean that this class is not obsolete?

Because in docs.microsoft.com it states clearly, This API is now obsolete.

@dotnet-bot dotnet-bot added the untriaged New issue has not been triaged by the area owner label Apr 15, 2020
@MSDN-WhiteKnight
Copy link
Contributor

See #2986 for prior discussion. SmtpClient is marked with ObsoleteAttribute in Xamarin/Mono, and due to docs site engine bug it causes the obsolete notice to be displayed for all frameworks. In .NET Framework/Core, it is not marked obsolete, but it's still considered legacy API (not updated to new protocol features).

@PRMerger12 PRMerger12 added the Pri3 Indicates issues/PRs that are low priority label Nov 11, 2020
@mdell-seradex
Copy link
Contributor

mdell-seradex commented Nov 4, 2021

It has been a year already and the docs still say this is obsolete in Framework 4. Can't this be manually corrected?
Specifically, this is at the top of the page where it says The SmtpClient type is now obsolete.
This is not true in all cases.

@eerhardt
Copy link
Member

eerhardt commented Nov 4, 2021

@dotnet/ncl - thoughts?

@karelz
Copy link
Member

karelz commented Nov 4, 2021

There is no mention of obsoletion in the docs beside Xamarin when I open them: SmtpClient docs

The Remarks section explicitly calls it out:

The SmtpClient class is obsolete in Xamarin. However:

  • It is included in the .NET Standard 2.0 and later versions and therefore must be part of any .NET implementation that supports those versions.
  • It is present and can be used in .NET Framework 4 through .NET Framework 4.8.
  • It is usable in .NET Core, but its use isn't recommended.

@karelz
Copy link
Member

karelz commented Nov 4, 2021

The original question has been answered in the docs, closing.

@karelz karelz closed this as completed Nov 4, 2021
@dotnet-bot dotnet-bot removed the untriaged New issue has not been triaged by the area owner label Nov 4, 2021
@mdell-seradex
Copy link
Contributor

mdell-seradex commented Nov 4, 2021

@karelz, the mention of obsolete in the docs is in the first paragraph (under Definition):
Allows applications to send email by using the Simple Mail Transfer Protocol (SMTP). The SmtpClient type is now obsolete.
The remarks section does not contradict this statement, or explicitly say "only in Xamarin".
It is confusing for the first paragraph to say this as most people won't ever reach the Remarks section to see it try and fail to explain further.

@karelz
Copy link
Member

karelz commented Nov 4, 2021

OK, that was missing in the original report - the link wasn't there and the text quoted was slightly different. Reopening.

I think we can change the text to "The SmtpClient type is now obsolete on some platforms and not recommended on others - see Remarks for details."
Would that satisfy your concerns?

@karelz karelz reopened this Nov 4, 2021
@mdell-seradex
Copy link
Contributor

mdell-seradex commented Nov 4, 2021

@karelz, that sounds much better. I believe that should clarify things sufficiently. Hopefully, the original poster agrees with me.

Thank you for your quick response.
It is most appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Net Pri3 Indicates issues/PRs that are low priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants