How to create mail ids in server dynamically

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mahendran
Forum Newbie
Posts: 3
Joined: Fri Sep 15, 2006 1:03 pm

How to create mail ids in server dynamically

Post by mahendran »

Hi everyone,

Iam mahendran and i working as a php programmer for the last 8months. I have a doubt to create mail ids in server dynamically using PHP.

I wants to write a program for generating alias email ids in server dynamically when user register into the site by giving his original id such as(yahoo,gmail,etc..). The created alias ids are given to other users whose see that user profile. The users can use this ailas id for send mails. if they send the mail they can goes to the original id of alias id of that user ....
this is my task.

user given originalid---makes--------> alias id---------------stored in server.

sending Mail----to------->alias id-----------search for---------->original id---------------->user inbox

Anyone have idea how to implement this by scripting. It is very useful for me.
Thanks to all
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

When you save a user's email to the database table, create another field for the alias. Generate a random 5-10 digit number for the alias or something. Be sure to index both the email and alias fields in the database.

When a user sends a message to the alias, pull the real email address by using the alias to look it up, then send the message. This is fairly easy to do.

If you get stuck, post your code and we will help you.
mahendran
Forum Newbie
Posts: 3
Joined: Fri Sep 15, 2006 1:03 pm

Post by mahendran »

Hi Astions,

First I would like to give my thanks to you for your nice reply. Actually what happens in my site is mail function can happening in server only. lets say you have an alias id of my domain. You send mail to this alias id from your inbox(like gmail,yahoo) the mail comes to my domain and take the original id for the corresponding alias id and the mail can forward to this original id.

Please suggest your ideas for the above issues.
Thanku
Post Reply