Here's an example application with comments so you know what different things do:
public class Startup { public void ConfigureServices(IServiceCollection services) {
And here is the application running on the console:

As you can see, the application pulls some information from the configured EmailOptions , and some data form the arguments passed to.
EDIT : these are the necessary packages:
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final", "Microsoft.Extensions.OptionsModel": "1.0.0-rc1-final", "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final"
source share