Skip to content

Cyrille-18/EmailSenderWithCsharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This project demonstrates how to send emails using the SMTP protocol with C# and .NET. The app reads SMTP configuration from an appsettings.json file and sends emails securely.

Requirements

  • .NET SDK (v9.0 or later)

  • An SMTP server (e.g., Gmail)

  • An App Password (if using Gmail with 2-step verification)

Installation

  1. Clone the repository:

    git clone https://github.com/Cyrille-18/EmailSenderWithCsharp.git
    
  2. Install dependancies:

     dotnet restore
    

Configurations

Create an appsettings.json file in the project root with the following content:

     {
     "EmailConfig": {
       "SmtpServer": "smtp.gmail.com",
       "SmtpPort": 587,
       "Email": "[email protected]",
       "AppPassword": "your App password"
     }
 }

About

A simple console application to send emails using C# and .NET.

Topics

Resources

Stars

Watchers

Forks

Languages