title: Sending an email from my contact form doesn't work
body: <p>I want to add contact to my website ,so I have searched on the internet for an example 
  and I found this example : </p>
  
  <pre><code>http://www.html-form-guide.com/contact-form/php-email-contact-form.html
  </code></pre>
  
  <p>I have followed the example but it didnt work, there is no email in my mailbox but it redirect me to the thank you page after the submit.</p>
  
  <p>I have changed the contact-form-handler.php to</p>
  
  <pre><code>&lt;?php 
  $errors = '';
  $myemail = 'myEmail@yahoo.fr';//&lt;-----Put Your email address here.
  if(empty($_POST['name'])  || 
     empty($_POST['email']) || 
     empty($_POST['message']))
  {
      $errors .= "\n Error: all fields are required";
  }
  
  $name = $_POST['name']; 
  $email_address = $_POST['email']; 
  $message = $_POST['message']; 
  
  if (!preg_match(
  "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i", 
  $email_address))
  {
      $errors .= "\n Error: Invalid email address";
  }
  
  if( empty($errors))
  {
      $to = $myemail; 
      $email_subject = "Contact form submission: $name";
      $email_body = "You have received a new message. ".
      " Here are the details:\n Name: $name \n Email: $email_address \n Message \n $message"; 
  
      $headers = "From: $myemail\n"; 
      $headers .= "Reply-To: $email_address";
  
      mail($to,$email_subject,$email_body,$headers);
      //redirect to the 'thank you' page
      header('Location: contact-form-thank-you.html');
  } 
  ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Contact form handler&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;?php
  echo nl2br($errors);
  ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My contact.html file :</p>
  
  <pre><code>&lt;form method="POST" name="contactform" action="contact-form-handler.php"&gt; 
              &lt;p&gt;
                  &lt;label for='name'&gt;Your Name:&lt;/label&gt; &lt;br&gt;
                  &lt;input type="text" name="name"&gt;
              &lt;/p&gt;
              &lt;p&gt;
                  &lt;label for='email'&gt;Email Address:&lt;/label&gt; &lt;br&gt;
                  &lt;input type="text" name="email"&gt; &lt;br&gt;
              &lt;/p&gt;
              &lt;p&gt;
                  &lt;label for='message'&gt;Message:&lt;/label&gt; &lt;br&gt;
                  &lt;textarea name="message"&gt;&lt;/textarea&gt;
              &lt;/p&gt;
                  &lt;input type="submit" value="Submit"&gt;&lt;br&gt;
                  &lt;/form&gt;
  &lt;script language="JavaScript"&gt;
  // Code for validating the form
  // Visit http://www.javascript-coder.com/html-form/javascript-form-validation.phtml
  // for details
  var frmvalidator  = new Validator("contactform");
  frmvalidator.addValidation("name","req","Please provide your name"); 
  frmvalidator.addValidation("email","req","Please provide your email"); 
  frmvalidator.addValidation("email","email","Please enter a valid email address"); 
  &lt;/script&gt;
  </code></pre>
  
  <p>and onther page contact-form-tank-you.html </p>
  
  <pre><code>&lt;div id="body"&gt;
          &lt;div class="content"&gt;
              &lt;h1&gt;Thank you!&lt;/h1&gt;
  Thank you for submitting the form. We will contact you soon!
  
  
          &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My used programs are:htmp ,wampserver,php 5.3.10</p>
  
  <p><strong>Update</strong></p>
  
  <p>I have opened my php.ini and this what I found:</p>
  
  <pre><code>    [mail function]
      ; For Win32 only.
      ; http://php.net/smtp
      SMTP = smtp.yahoo.fr
      ; http://php.net/smtp-port
      smtp_port = 25
  
      ; For Win32 only.
      ; http://php.net/sendmail-from
      sendmail_from = myMail@yahoo.fr
  </code></pre>
  
  <p>I have logged to logs/appache_error ans I found this error:</p>
  
  <pre><code>[Thu Dec 27 10:11:51 2012] [error] [client 127.0.0.1] PHP Warning:  mail() [&lt;a href='function.mail'&gt;function.mail&lt;/a&gt;]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. dm3sm56414314wib.9 in C:\\wamp\\www\\MyWebsitname\\en\\contact-form-handler.php on line 32, referer: http://localhost/MyWebsitname/en/contact.html
  </code></pre>
  
  <p>So I have searched in the internet and I found that I shoul add </p>
  
  <pre><code>ini_set("SMTP","ssl://smtp.gmail.com");
  ini_set("smtp_port","465");
  </code></pre>
  
  <p>but the problem is the same?</p>