Emails sent by C# code ending up in junk mail

USING windows 2003 SBS and ASP.net in C#

i am using this code to send email to different users "within" the Co. using the code below, the problem is almost all the time the emails are ending up in users JUNK mail !!! some even changed in Outlook and mark as not junk but again it marks it in junk, is there anyway i can mark this in server to be NOT junk? so regardless of what user does it ends up in their inbox?

Thanks,


MailMessage mail2 = new MailMessage();
                mail2.To = (Email_From);
                mail2.From = ("test@mycomp.com");
                mail2.Subject = "your comments has been Published!";
                mail2.Body = "To view the comment click here: http://co/marketing/m2Display.aspx?ID=" + comID;
                SmtpMail.SmtpServer = "192.168.100.100";
                SmtpMail.Send(mail2);

Open in new window

Raul77Asked:
Who is Participating?
 
Kumaraswamy RCommented:
HI

My suggestion :
   use the System.net.mail Namespace , this is feacture of asp.net 2.0
   this is the System.Web.mail Namespace is asp.net 1.1

More Info

http://www.systemnetmail.com/
0
 
gemailjCommented:
0
 
gemailjCommented:
note that when adding the html to the mail he uses this method
System.Net.Mail.AlternateView htmlView = System.Net.Mail.AlternateView.CreateAlternateViewFromString(BodyText, null, text/html);

Open in new window

0
 
lenordisteCommented:
some quick info based on my own experience and dealing with ISPs:
-make sure your mailfrom is actually a valid address
-include a text version to your html email
-avoid strong punctuation in your subjects ("!!!" is a good wayt to the spam box)

run a spam assassin test on your generated emails to make sure there's nothing you overlooked (you can use this tool for instance):
http://www.mailingcheck.com/
0
 
jazzIIIloveCommented:
While I was dealing with my code, I had used a similar line as follows:
objEmail.Priority = MailPriority.High;

and I don't have any problem but e.g. I had hesitated using strong punc. as lenordiste advices.
and thanks for the link, gemailj. I really love EE:D

Best regards.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.