This tutorial will show you how to send an email in .NET Core 2.0 using SMTP in C# Code

From .NET Core 2.0 version you can use SmtpClient class to send an email

SmtpClient client = new SmtpClient("your smtp server");
client.Port = [your port];
client.UseDefaultCredentials = false;
client.Credentials = new NetworkCredential("your username", "your password"); 
MailMessage mailMessage = new MailMessage();
mailMessage.From = new MailAddress("your email");
mailMessage.To.Add("your receiver mail");
mailMessage.Body = "body";
mailMessage.Subject = "mail subject";

if you use gmail to send email, you can edit your smtp gmail as shown below

SmtpClient client = new SmtpClient("");
client.Port = 587;
client.UseDefaultCredentials = true;