C# yield return and yield break: Writing Iterators
How yield return and yield break turn a method into a lazy iterator in C#, with examples, async iterators, and the traps around deferred execution.
How yield return and yield break turn a method into a lazy iterator in C#, with examples, async iterators, and the traps around deferred execution.
Send email with attachments through Gmail from C# using MailKit and an app password, plus the OAuth 2.0 option and notes on legacy SmtpClient code.
Outlook.com and Hotmail no longer accept passwords over SMTP. Send email with attachments from C# using MailKit and an OAuth 2.0 token from MSAL.
Send email with attachments through Yahoo Mail’s SMTP server from C# with MailKit and a Yahoo app password, without hard-coding credentials.
How to declare optional parameters with default values in C#, call them with named arguments, and avoid the versioning trap that comes with them.