The emails that I have been sending via sendmail using Javamail are going into Spam folder.My username is from gmail.So it goes to other gmail users perfectly.It doesn't work with yahoo or hotmail or any other email sites.It lands in Junk.Has anyone ever come across this issue.
I have attached the code
boolean debug = false;
Which SMTP server are you using? Gmail? Or are you running your own? If the latter, then the MX record of the mail server responsible for the email address you're using (Gmail) doesn't vibe with the sending mail server, and that's often seen as an indicator of spam.