title: Sending mails from localhost to gmail or yahoo or rediff?
body: <p>i am working on sending email to any recipient like yahoo gmail 
  my code is
  contact form</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Email Form &lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;form method="post" action="sendeail.php"&gt;
  
  &lt;!-- DO NOT change ANY of the php sections --&gt;
  &lt;?php
  $ipi = getenv("REMOTE_ADDR");
  $httprefi = getenv ("HTTP_REFERER");
  $httpagenti = getenv ("HTTP_USER_AGENT");
  ?&gt;
  
  &lt;input type="hidden" name="ip" value="&lt;?php echo $ipi ?&gt;" /&gt;
  &lt;input type="hidden" name="httpref" value="&lt;?php echo $httprefi ?&gt;" /&gt;
  &lt;input type="hidden" name="httpagent" value="&lt;?php echo $httpagenti ?&gt;" /&gt;
  
  
  Your Name: &lt;br /&gt;
  &lt;input type="text" name="visitor" size="35" /&gt;
  &lt;br /&gt;
  Your Email:&lt;br /&gt;
  &lt;input type="text" name="visitormail" size="35" /&gt;
  &lt;br /&gt; &lt;br /&gt;
  &lt;br /&gt;
  Attention:&lt;br /&gt;
  &lt;select name="attn" size="1"&gt;
  &lt;option value=" Sales n Billing "&gt;Sales n Billing &lt;/option&gt; 
  &lt;option value=" General Support "&gt;General Support &lt;/option&gt; 
  &lt;option value=" Technical Support "&gt;Technical Support &lt;/option&gt; 
  &lt;option value=" Webmaster "&gt;Webmaster &lt;/option&gt; 
  &lt;/select&gt;
  &lt;br /&gt;&lt;br /&gt;
  Mail Message:
  &lt;br /&gt;
  &lt;textarea name="notes" rows="4" cols="40"&gt;&lt;/textarea&gt;
  &lt;br /&gt;
  &lt;input type="submit" value="Send Mail" /&gt;
  &lt;br /&gt;
  &lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and senemail.php</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; 
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; 
  &lt;title&gt;Sendemail Script&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;!-- Reminder: Add the link for the 'next page' (at the bottom) --&gt; 
  &lt;!-- Reminder: Change 'YourEmail' to Your real email --&gt; 
  
  &lt;?php
  
  $ip = $_POST['ip']; 
  $httpref = $_POST['httpref']; 
  $httpagent = $_POST['httpagent']; 
  $visitor = $_POST['visitor']; 
  $visitormail = $_POST['visitormail']; 
  $notes = $_POST['notes'];
  $attn = $_POST['attn'];
  
  
  if (eregi('http:', $notes)) {
  die ("Do NOT try that! ! ");
  }
  if(!$visitormail == "" &amp;&amp; (!strstr($visitormail,"@") || !strstr($visitormail,"."))) 
  {
  echo "&lt;h2&gt;Use Back - Enter valid e-mail&lt;/h2&gt;\n"; 
  $badinput = "&lt;h2&gt;Feedback was NOT submitted&lt;/h2&gt;\n";
  echo $badinput;
  die ("Go back! ! ");
  }
  
  if(empty($visitor) || empty($visitormail) || empty($notes )) {
  echo "&lt;h2&gt;Use Back - fill in all fields&lt;/h2&gt;\n";
  die ("Use back! ! "); 
  }
  
  $todayis = date("l, F j, Y, g:i a") ;
  
  $attn = $attn ; 
  $subject = $attn; 
  
  $notes = stripcslashes($notes); 
  
  $message = " $todayis [EST] \n
  Attention: $attn \n
  Message: $notes \n 
  From: $visitor ($visitormail)\n
  Additional Info : IP = $ip \n
  Browser Info: $httpagent \n
  Referral : $httpref \n
  ";
  
  $from = "From: $visitormail\r\n";
  
  
  mail("YourEmail", $subject, $message, $from);
  
  ?&gt;
  
  &lt;p align="center"&gt;
  Date: &lt;?php echo $todayis ?&gt; 
  &lt;br /&gt;
  Thank You : &lt;?php echo $visitor ?&gt; ( &lt;?php echo $visitormail ?&gt; ) 
  &lt;br /&gt;
  
  Attention: &lt;?php echo $attn ?&gt;
  &lt;br /&gt; 
  Message:&lt;br /&gt; 
  &lt;?php $notesout = str_replace("\r", "&lt;br/&gt;", $notes); 
  echo $notesout; ?&gt; 
  &lt;br /&gt;
  &lt;?php echo $ip ?&gt; 
  
  &lt;br /&gt;&lt;br /&gt;
  &lt;a href="contact.php"&gt; Next Page &lt;/a&gt; 
  &lt;/p&gt; 
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>what changes i have to made in my localhost so that i would be able to send the mail... </p>
  
  <p>thanks.</p>