public static void Send_email(this string email)
{
MailMessage mail = new MailMessage();
mail.To.Add(email);
mail.From = new MailAddress("Sender_email@gmail.com");
mail.Subject = "Welcome to eStudiez!!!";
mail.Body = "<h3>You have registered <span
style=\"color:green;\">Successfully</span><br />Please wait for the admin to approve you </h3>";
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Port = 587; // 25 465
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.Host = "smtp.gmail.com";
smtp.Credentials = new System.Net.NetworkCredential("Sender_email@gmail.com", "apppassword");
smtp.Send(mail);
smtp.Dispose();
}
Heading
Email is sending through C#(.NET) but on the other end it is receiving in spam section