First, we must assume that you are currently storing the username/login, password and the email address in a mySQL table. Once we know the username/login, we simply use that to locate the password and utilize the mail() function to send it.
Your snippet would be something like this :
$result = mysql_query ("SELECT password,email FROM yourtable WHERE username = '$username'");
if ($myrow = mysql_fetch_array($result))
{
$mailaddress = $myrow["email"];
$subject = "Important Message"; // don't say password in subject
$message = "Your password is: " . $myrow["password"] ;
$header = "Ancillary message or other stuff";
mail($mailaddress,$subject,$message,$header);
}
Hope this is helpful.
- Home
-
Store
- Browse All
- Linux Shared Hosting Plan
- Linux Cloud Server
- Linux Dedicated Server
- Linux Reseller Web Hosting Plan
- Windows Shared Hosting Plan
- Windows Cloud Server
- Windows Dedicated Server
- Windows Reseller Web Hosting Plan
- Sharepoint Hosting
- VPS Server
- SSL Certificates
- SEO Services
- Email Hosting
- Sitelock
- webhostforasp.net.au
- Register a New Domain
- Transfer Domains to Us
- Announcements
- Knowledgebase
- Network Status
- Affiliates
- Contact Us
-
More