"; // Your message $messages= "Your password for login to our website \r\n"; $messages.="Your password is $your_password \r\n"; $messages.="more message... \r\n"; // send email $sentmail = mail($to,$subject,$messages,$header); } if($count == 0) { $sql1="SELECT password FROM vendor WHERE v_email='$email_to'"; $result1=mysql_query($sql1); // if found this e-mail address, row must be 1 row // keep value in variable name "$count" $count1=mysql_num_rows($result1); // compare if $count =1 row if($count1==1) { $rows1=mysql_fetch_array($result1); // keep password in $your_password $your_password=$rows1['password']; // ---------------- SEND MAIL FORM ---------------- // send e-mail to ... $to=$email_to; // Your subject $subject="Your password here"; // From $header="from: Campaign Monitering System "; // Your message $messages= "Your password for login to our website \r\n"; $messages.="Your password is $your_password \r\n"; $messages.="more message... \r\n"; // send email $sentmail = mail($to,$subject,$messages,$header); } } // else if $count not equal 1 else { $_SESSION['errmsg']="Not found your email in our database"; } // if your email succesfully sent if($sentmail){ $_SESSION['errmsg']="Your Password Has Been Sent To Your Email Address."; } else { $_SESSION['errmsg']="Cannot send password to your e-mail"; } } ?> Converge