This is a demo project for sending email through Gmail SMTP in C#.
Setting up your basic config in ./EmailSender/appsettings.json
{
"AppSettings": {
"Account": "sender@gmail.com",
"Password": "your email password",
"Receivers": [
"receiver1@gmail.com",
"receiver2@gmail.com"
],
"Attachment": "attachment file path"
}
}
Sending email
cd ./EmailSender
$ dotnet run
Hello, World!
Successfully sent the email from sender@gmail.com to receiver1@gmail.com
Successfully sent the email from sender@gmail.com to receiver2@gmail.com