How to apply SMTP Authentication to my mail
<p>The code below is my mail code that send passsword to mail but it does not go to yahoo and gmail i want to add STMP authentication to it how can i do that.</p>

<pre><code> &lt;?php
     if(isset($_POST['submit'])){
 If(empty($_POST['email'])) {
 echo 'Please fill in the required fields!';

     }else{

        $email_to = $_POST['email'];
         $sql = "SELECT statue FROM statue WHERE mail='$email_to'";
         $result = mysql_query($sql);

             $count=mysql_num_rows($result);
             if($count==1){
             $rows = mysql_fetch_array($result);
             $your_password = $rows['statue'];

         $to = $email_to;
        $subject = "Your password here";
         $headers  = 'MIME-Version: 1.0' . "\r\n";
         $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
         $headers .="from: Alinke &lt;support@mydomain.com&gt;";


            $messages ="Here is your password : $your_password";
             $sentmail = mail($to,$subject,$messages,$headers);
             }else{
             echo 'your email can not be found in our database';
         }

             if($sentmail){
                 echo 'Your password has been sent to your email address.';
             }else{
                 echo 'Cannot send password to your e-mail address';
             }
     }
 }
</code></pre>

<p>?></p>
