title: PHPMailer sends duplicate emails
body: <p><strong>PROBLEM:</strong> I'm receiving three duplicate emails for each user who signs up with their email address. My guest list is being overrun by duplicate emails, and I don't know what's wrong with my code. </p>
  
  <blockquote>
    <p><strong>Probable Cause</strong>: I have 3 signup forms, so I think somehow when I submit one signup form they all submit at the same time. The problem lies in either the Bootstrap 4.1.3 JS or the HTML. </p>
  </blockquote>
  
  <p><strong>PHP Code:</strong></p>
  
  <pre><code>$email = $_REQUEST['email'] ;
  
  // Import PHPMailer classes into the global namespace
  // These must be at the top of your script, not inside a function
  use PHPMailer\PHPMailer\PHPMailer;
  use PHPMailer\PHPMailer\Exception;
  
  require './PHPMailer-master/src/Exception.php';
  require './PHPMailer-master/src/PHPMailer.php';
  require './PHPMailer-master/src/SMTP.php';
  
  // Popup Form Signup
  $mail = new PHPMailer();
  $mail-&gt;IsSMTP();
  $mail-&gt;Host = "mail.domain.com";
  $mail-&gt;SMTPAuth = true;
  $mail-&gt;Username = "user@domain.com"; 
  $mail-&gt;Password = "password"; 
  $mail-&gt;SMTPSecure = 'TLS';                           
  $mail-&gt;Port = 587;
  $mail-&gt;From = $email;
  $mail-&gt;setFrom('$email', 'Guest');
  $mail-&gt;addAddress('admin@domain.com', 'Admin');
  $mail-&gt;IsHTML(true);
  $mail-&gt;Subject = "New Member!";
  $mail-&gt;Body = $email;
  $mail-&gt;AltBody = $email;
  
  $mail2 = new PHPMailer();
  $mail2-&gt;IsSMTP();
  $mail2-&gt;Host = "mail.domain.com"; 
  $mail2-&gt;SMTPAuth = true; 
  $mail2-&gt;Username = "user@domain.com"; 
  $mail2-&gt;Password = "password"; 
  $mail2-&gt;SMTPSecure = 'TLS';                      
  $mail2-&gt;Port = 587;                             
  $mail2-&gt;setFrom('support@domain.com', 'Support');
  $mail2-&gt;AddAddress("$email");    
  $mail2-&gt;AddReplyTo('support@domain.com');
  
      $mail2-&gt;Subject = "Thanks for signing up!";
      $message = '';
      $mail2-&gt;Body = $message;
      $mail2-&gt;AltBody = $message;
  
  
      if(!$mail2-&gt;Send())
      {
      echo "Message could not be sent. Please reload the page and try again. &lt;p&gt;";
      echo "Mailer Error: " . $mail2-&gt;ErrorInfo;
      exit;
      }
  
      if(!$mail-&gt;Send())
      {
      echo "Message was not received. Please reload the page and try again.&lt;p&gt;";
      echo "Mailer Error: " . $mail-&gt;ErrorInfo;
      exit;
      }
  </code></pre>
  
  <p>I also have other Forms that open different PHP files, but they shouldn't be the issue here. I just added it here just in case anyone can figure something out. </p>
  
  <p><strong>FORM 1 (Same Landing Page)</strong></p>
  
  <pre><code>&lt;form class="signupForm1 input-group mt-1" method="post" action="topconfirm"&gt;
          &lt;div class="input-group"&gt;
          &lt;label for="email" class="sr-only"&gt;Enter your email address&lt;/label&gt;
          &lt;input style ="overflow:hidden;" id="email" type="email" name="email" required class="sentence form-control" aria-label="Large" placeholder="enter your email address"&gt;      
          &lt;button style="font-size:17px;" name="topsubmit" type="submit" class="ctabutton semibolder submitButton sentence text-white btn btn-secondary px-lg-3 px-md-1 px-sm-1 btn-lg rounded-0"&gt;Get Started&lt;/button&gt;
          &lt;/div&gt;              
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>FORM 2 (Same Landing Page)</strong></p>
  
  <pre><code>&lt;form class="signupForm2 input-group mt-1" method="post" action="bottomconfirm"&gt;
                  &lt;div class="input-group"&gt;
                  &lt;label style="font-weight:normal!important;" for="email" class="sr-only"&gt;Enter your email address&lt;/label&gt;
                  &lt;input style ="overflow:hidden;"  id="email" type="email" name="email" required class="sentence form-control" aria-label="Large" placeholder="enter your email address"&gt;         
                  &lt;input style="font-size:17px;" name="footersubmit" type="submit" class="ctabutton semibolder submitButton sentence text-white btn btn-secondary px-lg-3 px-md-1 px-sm-1 btn-lg rounded-0" value="Get Started"/&gt;
                  &lt;/div&gt;              
          &lt;/form&gt;
  </code></pre>
  
  <p>I'm not a JavaScript or PHP mailer expert someone please show me how to fix this problem, I think it might be a Bootstrap JS 4.13. Any suggestion or help will be greatly appreciated. Thanks!  </p>