This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Sending mails from same domain Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Sending mails from same domain" Watch "Sending mails from same domain" New topic

Sending mails from same domain

Anjali S Sharma
Ranch Hand

Joined: Jun 29, 2005
Posts: 279
I am using Java mail API to send emails. I have installed SMTP server on my system.
So in Java class, I am setting the property "" as "127.0..0.1".

The email id to which I am sending emails is "". In the "from" field the email id being set is "". The emails are send perfectly fine.
from= ""

Now I changed the from email address to "" (the domain for "to" and "from" is the same). Now the emails have stopped going. In other words, whenever I change the domain of "from" address to be different from the domain of "to" address the emails go fine. As soon as I give the same domain ("tes" in this case) for both "to" and "from" email address the emails stop going. Can someone please let me know why this problem? Is this a SMTP restriction or Java mail restriction?

Thank you
I agree. Here's the link:
subject: Sending mails from same domain
It's not a secret anymore!