How to send Email with PhpMailer and WAMP
<p>I dont know what else to do to make email sending works using phpmailer and WampServer. I have configured WAMP just as a I read in a lot of forums, but I cant make it work. I have this example:</p>

<pre><code>&lt;?php 
if(isset($_POST['email'])){
    //envia correo desde el servidor local (pruebas)
    include("clases/class.phpmailer.php");
    include("clases/class.smtp.php");
    $mail = new PHPMailer();
    $mail-&gt;IsSMTP();
    $mail-&gt;SMTPAuth = true;
    $mail-&gt;SMTPSecure = "ssl";
    $mail-&gt;Host = "smtp.gmail.com";
    $mail-&gt;Port = 587;
    $mail-&gt;Username = "restofinder2016@gmail.com";
    $mail-&gt;Password = "****";

    $mail-&gt;From = "restofinder2016@gmail.com";
    $mail-&gt;FromName = "Resto";
    $mail-&gt;Subject = "Subject del Email";
    $mail-&gt;AltBody = "Hola, te doy mi nuevo numero\nxxxx.";
    $mail-&gt;MsgHTML("Hola, te doy mi nuevo numero&lt;br&gt;&lt;b&gt;xxxx&lt;/b&gt;.");
    //$mail-&gt;AddAttachment("files/files.zip");
    //$mail-&gt;AddAttachment("files/img03.jpg");
    $mail-&gt;AddAddress($_POST['email'], "user name");
    $mail-&gt;IsHTML(true);

    if(!$mail-&gt;Send()) {
        echo "Error: " . $mail-&gt;ErrorInfo;
        return false;
    }

    //fin enviar correo usuando servidor local  
}
?&gt;

&lt;form id="form1" name="form1" method="post" action=""&gt;
    &lt;p&gt;
        &lt;label for="email"&gt;&lt;/label&gt;
        &lt;input type="text" name="email" id="email" /&gt;
    &lt;/p&gt;
    &lt;p&gt;
        &lt;input type="submit" name="enviar" id="enviar" value="Enviar" /&gt;
    &lt;/p&gt;
&lt;/form&gt;
</code></pre>

<p>I was told that it doesnt work with gmail, that I should use some other kind of mail. I get this error:</p>

<p>SMTP Error: Could not connect to SMTP host. Error: SMTP Error: Could not connect to SMTP host.</p>

<p>What can I do to make it work?</p>

<p>Thank you very much!</p>