This content originally appeared on DEV Community and was authored by Joe Enos
.NET Framework used to use SmtpClient, which read this from the app.config/web.config file:
<mailSettings>
<smtp deliveryMethod="Network">
<network host="my-host"
port="587"
userName="my-user"
password="my-password"
enableSsl="true"
defaultCredentials="false"
/>
</smtp>
</mailSettings>
Microsoft has deprecated SmtpClient, and they recommend a library like MailKit.
MailKit is a little more verbose than the old way, but it's still reasonably straightforward. Here's how to use it:
This content originally appeared on DEV Community and was authored by Joe Enos
Joe Enos | Sciencx (2021-05-22T07:28:46+00:00) Send email with MailKit in .NET. Retrieved from https://www.scien.cx/2021/05/22/send-email-with-mailkit-in-net/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.