[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1757
  • Last Modified:

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

0
Raul77
Asked:
Raul77
1 Solution
 
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
 
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now