Here is the script that I have so far:
Code: Select all
<?php
$Name=$UName;
$Address=$Email;
$server="localhost";
$login="ht08orga_master";
$password="utprosim";
$link = mysql_connect($server, $login, $password);
mysql_select_db('ht08orga_BBBTest',$link);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
print "&status=Connected successfully, $Name, retrieving data.";
$query = "SELECT id, Email, FName, Password, UserName FROM users WHERE UserName = '$Name' AND Email = '$Address'";
$data = mysql_query($query);
while ($row = mysql_fetch_assoc($data)) {
$id = $rowї'id'];
$Contact = $rowї'FName'];
$Password = $rowї'Password'];
$User = $rowї'UserName'];
}
if (!$data) {
die("&status=No login data exists for the specified user, please try again.");
}
else
{
print "&status=$Contact, your login information has been sent to your email address at $Email";
/* subject */
$subject = "Password reminder from www.BruinBand.net";
/* message */
$message = "$Contact, this automated email is to give you your password so you can log in successfully. If you did not request this email, it means that someone may have made an attempt to access your account.\r\n
If this is the case, please contact us at Hostmaster@bruinband.net to resolve the issue.\r\n
Here is the information that you requested:\r\n\n
---------------------------------------\r\n
User Name: $User\r\n
Password: $Password\r\n
---------------------------------------\r\n\n
Thank you for visiting www.BruinBand.net, we hope you come back to visit soon.
";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: html; charset=iso-8859-1\r\n";
/* additional headers */
$headers .= "To: $Email\r\n";
$header .= "From: Bruin Band Hostmaster <webmaster@ht08.org>\r\n";
$header .= "Reply-To: Bruin Band Hostmaster <Hostmaster@bruinband.net>\r\n";
/* and now mail it */
mail($Address, $subject, $message, $headers);
}
?>1) It also sends the email to unknown user name and email combinations.
2) Even though I have the Content-Type as HTML, when I attempt to send the message with HTML tags, they appear as text.
3) It sends two email as opposed to one.
4) And finally, Outlook displays the email as from "root@host255.iPowerWeb.com" as opposed to "Hostmaster@bruinband.net" like I have the Reply to set as.
If anyone can help me with any or all of these problems, I would greatly appreciate it.
Thankyou,
--Andrew Steenbuck