hello every one
im trying to send Email using ASP.NET with C#
but when recieved it is marked as spam
this is a problem...
i searched alot and almost i put every thing to avoid marking my emails as spam..but all didn't work
this is the piece of code i use
MailMessage mail = new MailMessage();
mail.To.Add(new MailAddress(ToMail));
mail.From = new MailAddress(FromMail);
mail.Subject = txtSubject.Text;
string Body = txtContent.Value;
mail.Body = Body;
mail.BodyEncoding = System.Text.Encoding.GetEncoding("utf-8");
mail.IsBodyHtml = true;
AlternateView plainView = AlternateView.CreateAlternateViewFromString
(System.Text.RegularExpressions.Regex.Replace(Body, @"<(.|\n)*?>", string.Empty), null, "text/plain");
System.Net.Mail.AlternateView htmlView = System.Net.Mail.AlternateView.CreateAlternateViewFromString(Body, null, "text/html");
mail.AlternateViews.Add(plainView);
mail.AlternateViews.Add(htmlView);
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
smtp.Credentials = new System.Net.NetworkCredential
(FromMail , Password);
//Or your Smtp Email ID and Password
smtp.EnableSsl = true;
smtp.Send(mail);
txtContent.Value = "";
txtSubject.Text = "";
waiting ur replies..
thnks in advance