I just started with c# and want to write a code for school project a mailer basically I want to send e-mails to all the emails saved in a txt file.
class Program
{
static void Main(string[] args)
{
var client = new SmtpClient("smtp.gmail.com", 587)
{
Credentials = new NetworkCredential("myusername@gmail.com", "mypwd"),
EnableSsl = true
};
client.Send("myusername@gmail.com", "myusername@gmail.com", "test", "testbody");
Console.WriteLine("Sent");
Console.ReadLine();
}
}
with this code I can send only to a single e-mail address I want a function to send e-mails to all the email address I've saved it in a txt file one by one with multi thread. HOW CAN I DO THIS ??