•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 425,929 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,707 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1450 | Replies: 3
![]() |
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 please let me know. It is very useful for me.
Thanks to all
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 please let me know. It is very useful for me.
Thanks to all
•
•
Join Date: Jul 2004
Location: North East Indiana
Posts: 491
Reputation:
Rep Power: 5
Solved Threads: 20
Sounds like you need something to generate a unique random user ID and associate it with the account you wish to use. Perl has just the right data type for that (oh shucks, this is PHP)... Uh Well you can still do it a couple different ways:
2-dimension array. Dimension 1 is the User ID and dimension 2 has the account info
multiple arrays: The index is the same for related info.
2-dimension array. Dimension 1 is the User ID and dimension 2 has the account info
multiple arrays: The index is the same for related info.
www.uncreativelabs.net
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
•
•
•
•
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 please let me know. It is very useful for me.
Thanks to all
Hello Mahendran,
I believe you want to create a system to where an email sent to user@yourdomain.com is forwarded to user@yahoo.com ?
You'll first need to save the users id, email id (on your domain) and real email in your database. That way you can reference te users real email in the database from their id, or a random email id generated for your domain.
To create a radom number is simple, see the rand() function: http://www.php.net/rand or mt_rand() which is faster.
Most random number generation uses something like:
[PHP]
$seed = mt_rand();
$random_number = sha1(time().$seed); // less subject to brute force
[/PHP]
This is better since someone utilizing brute force or a dictionary type attack to get the emails has to "guess" two things: time() and mt_rand() which are enclosed in a non-reversable hash: sha1().
The real questions for implementing what you want are:
1) do you want to set up an email for each user on your site?
2) Do you want to set up a forwarder for each users email on your site?
If you want to set up an email for all users on your site, then you can easily set up a forwarder, that will forward the users email to say username@yahoo.com
Setting up emails and forwarders can be done dynamically when a user registers, its platform dependant though.
An easier way to have everything handles by php is to just route all your incoming mail to your domain to a php script, then have the php script forward email for you to the appropriate email address.
To have all your incoming mail sent to a php script, you need to set up a catch-all email address, and set up a forwarder that will send (pipe) all this mail to the php script.
A good reference is here: http://evolt.org/incoming_mail_and_php
Or you can query "email piping to php".
When your php script receives the email, it can check for the "to" header which should be something like user@yoursite.com and check with your database as to the email to forward to, eg: user@yahoo.com
To forward the email just mail it.. see mail() function in php.net manual.
----
However, a much easier thing to do is to just set up a form on the users profile page that sends email to the user.
That way you can also limit that page to say members only of your site.
If you create an email id for each user on your domain, and it forwards to the users real email, it still is sending email to the user and still subject to spam, even though the sender does not know the users real email address..
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Online voting (PHP)
- create subdomain in server dynamically using php (PHP)
- php plan for a voting system? (PHP)
- PHP, ASP, ColdFusion, what's your fav? (IT Technologies and Trends)
- generating txt using php (PHP)
- Community Based Website Looking For PHP Assistant (PHP)
Other Threads in the PHP Forum
- Previous Thread: Encoder for PHP
- Next Thread: How To Find PHP Coders


Linear Mode