title: How to use smtp function in php with authentication
body: <p>My code is as given below. I would like to know how to use smtp function in php with authentication in contact form. If I use hotmail id I am not able to recive the inquiry but it works fine for gmail id. It would be great if someone help in me editing my code noted below</p>
  
  <pre><code>    &lt;?php
  $name = $_POST['name'];
  $email = $_POST['email'];
  $phone = $_POST['phone'];
  $message = $_POST['message'];
  $formcontent=" Name: $name \n Email: $email \n Phone: $phone \n Message: $message";
  $to = "abc@hotmail.com";
  $subject = "Contact Form";
  $mailheader = "From: $name \r\n";
  mail($to, $subject, $formcontent, $mailheader) or die("Error!");
  echo "&lt;br&gt;&lt;br&gt;&lt;p style='color:#000'&gt;&lt;b&gt;Thank You $name&lt;/b&gt;&lt;/p&gt;&lt;p style='color:#000'&gt;We will be in touch as soon as possible.&lt;/p&gt;";
  echo "&lt;p style='color:#000'&gt;Go to &lt;a href='index.html'&gt;&lt;b&gt;Home Page&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;";
  ?&gt;
  </code></pre>