Well, first of all you wouldn't use a servlet. Servlets process HTTP requests, but e-mail has nothing to do with HTTP.
What you do is this:
1. Set up an e-mail server that can receive e-mails at mydomain.com.
2. Make sure it's set up to reject as much spam as possible.
3. Program it so that when it receives a message for firstname.lastname@example.org, it finds out what real address that corresponds to and resends a copy of the message (presumably including the advertising that pays for your site) to that real address.
Originally posted by azhar bharat: I dont think you guys understood what i meant.
I understood perfectly well what you meant.
The problem is I cant configure the mail server manually evertime a new user signs up. I want a way to do it programatically.
You're the one not understanding. When the user signs up you put their information in a database. When your server gets an e-mail for their alias, it looks in the database and forwards the message to their real address.
Joined: Jul 17, 2006
Originally posted by Paul Clapham: When your server gets an e-mail for their alias, it looks in the database and forwards the message to their real address.
But how does my application know that a mail has arrived in the mail server?