Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MailMessage mail = new MailMessage();
- mail.To.Add("hira.aftab87@gmail.com");
- // mail.To.Add("amit_jain_online@yahoo.com");
- mail.From = new MailAddress("jagdeepmatharu@gmail.com");
- mail.Subject = "Email using Gmail";
- string Body = "Hi, this mail is to test sending mail" +
- "using Gmail in ASP.NET";
- mail.Body = Body;
- mail.IsBodyHtml = true;
- SmtpClient smtp = new SmtpClient();
- smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
- smtp.Port = 587;
- smtp.Credentials = new System.Net.NetworkCredential
- ("jagdeepmatharu@gmail.com", "root.8787");
- //Or your Smtp Email ID and Password
- smtp.EnableSsl = true;
- smtp.Send(mail);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement