PHPMailer Gmail SMTP Contact Us Form AddReplyTo
===

I have the following code. As you can see im setting the replyTo field to the email inputted inside the contact us form. However this does not work. Everytime i receive an email from my contact form, I then need to copy the email (which is in my message body) and paste it into the "to" field. Since the to field will ignore the fact i placed a different replyto email and simply use my websites email. Any idea what could be wrong?

    require_once('mailer/class.phpmailer.php');

    $mail             = new PHPMailer();

    $mail->IsSMTP(); // telling the class to use SMTP
    $mail->Host       = "smtp.gmail.com"; // SMTP server
    $mail->SMTPDebug  = 1;                     // enables SMTP debug information (for testing)
                                               // 1 = errors and messages
                                               // 2 = messages only
    $mail->SMTPAuth   = true;                  // enable SMTP authentication
    $mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
    $mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
    $mail->Port       = 465;                   // set the SMTP port for the GMAIL server
    $mail->Username   = "email";  // GMAIL username
    $mail->Password   = "password";            // GMAIL password
	
    $mail->SetFrom("mywebsitesemail", "my name");
    $mail->AddAddress("mywebsitesemail", "my name");
    $mail->AddReplyTo("$email","$name");

    $mail->Subject    = "Subject";

    $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test

    $mail->MsgHTML("$message");



    $mail->Send();