[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

CDO created message goes as Junk mail in Outlook

Hi everybody,
In my web application i have a functunality to send mails to users ( i've done this many times )
The problem that i have right now is that these messages are recognized as Junk Mail from Microsoft Outlook 2003
I've tried to manage the headers but with no luck
are there some rules that can be keep to mails not goin' as a Junk Mail

Thanks
0
mmarinov
Asked:
mmarinov
  • 8
  • 6
1 Solution
 
chaniewskimCommented:
Could you please post your CDO code?
0
 
chaniewskimCommented:
It can go to junk folder if you fill only From field of message.
Try to add Reply-To header with the same email.
0
 
mmarinovAuthor Commented:

System.Web.Mail.MailMessage mes = new System.Web.Mail.MailMessage();
mes.To = "someemail@some.com";
mes.From = "from@some.com";
mes.Subject = "Subject";
mes.Body = "this is a body of message";
mes.BodyFormat = System.Web.Mail.MailFormat.Html;
mes.Headers.Add("content-type","text/html; charset=windows-1251");

System.Web.Mail.SmtpMail.SmtpServer = ConfigurationSettings.AppSettings["SMTPServer"];//this is localhost
System.Web.Mail.SmtpMail.Send( mes );

b..m

0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
chaniewskimCommented:
mes.Headers.Add("Return-path","from@some.com");
mes.Headers.Add("Message-ID","123445@some.com");


RFC 822 defines message-ID as a unique identifier for each version of each message, in the form local-part@domain.

Example
123456@microsoft.com
0
 
chaniewskimCommented:
look for example at headers of emails from expert-exchange
you have return-path and message-id there
and maybe you'll find other hints there if it is not enough
0
 
chaniewskimCommented:
and of course not 'Reply-To header' but 'Return-path header' , disregard my second answer
0
 
mmarinovAuthor Commented:
ok
the wird problem is that:
now when i use the code posted above is not moving my message to the Junk Mail
but if i add

mes.Body = "<img src=\"http:/localhost/vpath/images/ok.gif\"this is a body of message";
the message was moved to the Junk Mail
Is there a format for the images when they are added to the message?

B..M
0
 
chaniewskimCommented:
Try to set complete HTML page as Body

mes.Body = "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\"><html><head></head><body><img src=\"http:/localhost/vpath/images/ok.gif\">this is a body of message</body></html>"
0
 
mmarinovAuthor Commented:
nope,
it won't work
i've tried it before and right now - and again i have Junk Mail :-(
0
 
chaniewskimCommented:
That filter looks for some kind of patterns: a lot of exclamations, ALL-CAPS-TEXT, 'Viagra'-like words etc.
Maybe it doesn't like messages with an image and a little of text. Try to compose your message in other way, add text on beginning or more text after image.

0
 
mmarinovAuthor Commented:
no this don't help me :(
i'll compare the EE newsletter message and check where is the problem
i'll post as fast as i get the rezult

i hope that there are other experts that were going through this problem and can share their solutions

THanks for now chaniewskim
B..M
0
 
chaniewskimCommented:
Try to insert a blank line after headers by using \r\n with last custom header.
0
 
mmarinovAuthor Commented:
no, this is not what is the problem
as i search through difference between one message that i received correctly and the other that not
there are too many difference in the Header section
so i'll have to change them and will folow up
B..M
0
 
mmarinovAuthor Commented:
hi chaniewskim,

the delay was so big and please excuse me for this
for some reason the problem rize when you send in the header you add
Content-Type: text/html; charset="windows-1251" ( this is for ciryllic )
so when i remove it everything goes correct

actually i think that all the things come from the Outlook because sometime when i receive an notification from Expert-exchange the Outlook move it again in the Junk Mail
So because the problem was solved and you've helped me a lot i think that you derved your point

Thanks

B..M
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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