Dear Team
WE are using ASP.Net with C#, for developing projects.
In many places we are sending emails to clients. These emails are reaching our clients SPAM box.
Please give solution to avoid this because it is keep on blocking our server and we are unable to proceed further.
Sample code is attached:
WE are using ASP.Net with C#, for developing projects.
In many places we are sending emails to clients. These emails are reaching our clients SPAM box.
Please give solution to avoid this because it is keep on blocking our server and we are unable to proceed further.
Sample code is attached:
Code:
string from = "asd@gmail.com";
string to = a.ToString();
MailMessage mail = new MailMessage();
mail.From = new MailAddress(from, "",system.text.encoding.UTF8);
mail.To.Add(a.ToString());
mail.subject="";
mail.SubjectEncoding = System.Text.Encoding.UTF8;
mail.body="";
mail.BodyEncoding = System.Text.Encoding.UTF8;
mail.IsBodyHtml = true;
mail.Priority = MailPriority.Normal;
try
{
SmtpClient client = new SmtpClient("smtp.gmail.com");
client.Credentials = new System.Net.NetworkCredential(from, "12345");
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Port = 587;
client.EnableSsl = true;
client.Send(mail);
}
Comment