Do you already have emails of users?
If you have an account on gmail, you can simply use it, to send emails to others.
What you need, is to create a list of users (with their emails is enough), and then do a loop through them and on each loop execute this code:
List<string> emails = new List<string>();
//fill the list with emails!
foreach(string email in emails)
System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
System.Net.NetworkCredential cred = new System.Net.NetworkCredential(”email@example.com”, “your password”); //of your email accout
mail.To.Add(”firstname.lastname@example.org”); //email of user //do through a loop
mail.Subject = “subject”;
mail.From = new System.Net.Mail.MailAddress(”email@example.com”);
mail.IsBodyHtml = true;
mail.Body = “message to send”;
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(”smtp.gmail.com”);
smtp.UseDefaultCredentials = false;
smtp.EnableSsl = true;
smtp.Credentials = cred;
smtp.Port = 587; //this is of gmail
Thanks for your reply..but am looking for sending emails to multiple email servers..for eg one user may have gmail account whereas the other with yahoo....So how can i send newsletters to all mail id in one click ...
public class GrossmontBank
//class variables (global - accessible throughout this class)
//scanner object to be used throughout
private static Scanner input = new Scanner(System.in);