SmtpClient was not available in earlier versions of .Net core, it is available in .Net Core 2.0. It is identical to what is in .Net framework. Ideally, the code to send email using SmtpClient you might have written in .Net framework should work in .Net Core 2.0 pretty much by copy-pasting. Here is the sample using Gmail SMTP server, it works on both .Net framework and .Net Core:

var smtpClient = new SmtpClient
    Host = "", // set your SMTP server name here
    Port = 587, // Port 
    EnableSsl = true,
    Credentials = new NetworkCredential("[email protected]", "password")

using (var message = new MailMessage("[email protected]", "[email protected]")
    Subject = "Subject",
    Body = "Body"
    await smtpClient.SendMailAsync(message);


If you see compiler errors like "The type or namespace name 'SmtpClient' could not be found...", just make sure target framework is .Net Core 2.0.