It may be that your message is violating some common spam rules, such as embedding raw html, using falgged words, etc.
However, if none of those are the case, then most likely this is because your machine's IP address is not listed in your DNS SPF record. The SPF record is a TXT record added to your domain DNS. If you do not have control of your DNS record than most likely it is always going to be flagged as spam.
If you do have control of your DNS, then I suggest adding your host to your SPF record.
Here is what a typical SPF record looks like:
"v=spf1 a:mailserver1.com ip:12.233.167.99 -all"
Just add your servers IP address to this and it should not go to your junk folder.
Have you got any junk email rules configured in your email client/server? – None – 2012-11-06T13:24:09.080
1Your code isn't putting the email in your Junk folder, a policy on your mail server probably is. What's your email setup? – rie819 – 2012-11-06T13:25:18.607
Pls post a sample email. Probably there is a pattern that is similar to some junk. – None – 2012-11-06T13:26:23.520
Junk mail represents a mail which its contents may not change that is sent many times to different users. In this case, the sender of the mail is considered a
spammer
and all the sender's messages are dropped to the recipient's Junk Folder. Did you try to send the message with a different sender? I believe this may fix the problem. Have a great day :) – None – 2012-11-06T13:31:13.763How are you sending? Who are you sending the email from? On the off chance you have sent from a made up address (perfectly possible if the smtp server is valid) the recieving server may decide to check the validity of the sent from address. Doubt this is the answer... but just incase :) – None – 2012-11-06T13:54:33.537