Emails from PHP form not being sent
<p>Ive added this code to my contact form to send 2 emails, one to the recipient and the other to the sender as confirmation... is there something in this code thats preventing both the email and confirmation mail being sent? </p>

<pre><code> &lt;?
ob_start();
if(isset($_POST['btnSubmit']))
{
require("class.phpmailer.php");

$mail = new PHPMailer();

//Your SMTP servers details

$mail-&gt;IsSMTP();               // set mailer to use SMTP
$mail-&gt;Host = "localhost";  // specify main and backup server or localhost
$mail-&gt;SMTPAuth = true;     // turn on SMTP authentication
$mail-&gt;Username = "hello@frogdigital.co.uk";  // SMTP username
$mail-&gt;Password = "*****"; // SMTP password
//It should be same as that of the SMTP user

$redirect_url = "http://".$_SERVER['SERVER_NAME']; //Redirect URL after submit the form

$mail-&gt;From = $mail-&gt;hello;    //Default From email same as smtp user
$mail-&gt;FromName = $_POST['fullname'];

$mail-&gt;AddAddress("hello@frogdigital.co.uk", "Frog Digital"); //Email address where you wish to receive/collect those emails.

$mail-&gt;WordWrap = 50;                                 // set word wrap to 50 characters
$mail-&gt;IsHTML(true);                                  // set email format to HTML

$mail-&gt;Subject = $_POST['service'];

$message = "&lt;b&gt;Name: &lt;/b&gt;".$_POST['fullname']." \r\n &lt;br&gt;&lt;br&gt;&lt;b&gt;Email: &lt;/b&gt;".$_POST['email']." \r\n &lt;br&gt;&lt;br&gt;&lt;b&gt;Service: &lt;/b&gt;".$_POST['service']." \r\n &lt;br&gt;&lt;br&gt;&lt;b&gt;Budget: &lt;/b&gt;".$_POST['budget']." \r\n &lt;br&gt;&lt;br&gt;&lt;b&gt;Comments: &lt;/b&gt;".$_POST['comments'];
$mail-&gt;Body    = $message;


if ($mail-&gt;send()){
  $autoemail = new PHPMailer();
  $autoemail-&gt;From = "hello@frogdigital.co.uk";
  $autoemail-&gt;FromName = "Frog Digital";
  $autoemail-&gt;AddAddress($mail-&gt;From, $mail-&gt;FromName);
  $autoemail-&gt;Subject = "Autorepsonse: We received your submission";
  $autoemail-&gt;Body = "We received your submission. We will contact you soon ...";
}




?&gt; 
</code></pre>
