php - $_POST values empty on server but works with localhost

one text

I have a VUE app posting to a PHP backend using PHPMailer for sending emails. In my local setup, the VUE frontend posts to PHP with no problem and emails are sending with content. Since migrating my code to a staging server, the frontend posts with no issue, emails are sending, but the emails are sending with no content. On form submission, formData is logging the correct values so it does look like the data is being sent, just something on the PHP side not working quiet right.

I'm a bit confused as to why this might be happening. If anyone is able to point out an issue or a better way to achieve what i'm trying to do it would be appreciated.

Submit Method

methods: {
    onSubmit() {
      this.sending =! this.sending;
      const formData = new FormData();
      formData.append('winningUid', this.winningUid);
      formData.append('name', this.form.name);
      formData.append('email', this.form.email);
      formData.append('address1', this.form.address1);
      formData.append('address2', this.form.address2);
      formData.append('city', this.form.city);
      formData.append('county', this.form.county);
      formData.append('postCode', this.form.postCode);
      formData.append('mobileNumber', this.form.mobileNumber);
      formData.append('deliveryInstructions', this.form.deliveryInstructions);
      formData.append('sfu', this.form.sfu);
    
      axios.post('/api', formData).then(res => {
        console.log('SUCCESS', res.data);
        this.mailSent = true;
        this.data_captcher = false;

        for (var pair of formData.entries()) {
          console.log(pair[0]+ ', ' + pair[1]); 
        }

      }).catch(err => {
        console.log('ERROR', err);
      });
    }
  }

Mailing Script

<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

require_once "vendor/autoload.php";

    // PHPMailer Object
    $mail = new PHPMailer(true); 

    // Test using SendGrid
    $mail->isSMTP();  
    $mail->SMTPAuth   = true;            
    $mail->Port       = 587;                
    $mail->Host       = 'xxx';
    $mail->Username   = 'xxx'; 
    $mail->Password     = 'xxx';

  // Vars
    $uid = isset($_POST['winningUid']) ? $_POST['winningUid'] : ''; 
    $name = isset($_POST['name']) ? $_POST['name'] : ''; 
    $email = isset($_POST['email']) ? $_POST['email'] : ''; 
    $address1 = isset($_POST['address1']) ? $_POST['address1'] : ''; 
    $address2 = isset($_POST['address2']) ? $_POST['address2'] : ''; 
    $city = isset($_POST['city']) ? $_POST['city'] : ''; 
    $county = isset($_POST['county']) ? $_POST['county'] : ''; 
    $postCode = isset($_POST['postCode']) ? $_POST['postCode'] : ''; 
    $mobileNumber = isset($_POST['mobileNumber']) ? $_POST['mobileNumber'] : ''; 
    $deliveryInstructions = isset($_POST['deliveryInstructions']) ? $_POST['deliveryInstructions'] : ''; 

    //From email address and name
    $mail->From = 'send@email.com';
    $mail->FromName = $name;

    //To address and name
    $mail->addAddress("send@email.com", "To");

    //Address to which recipient will reply
    $mail->addReplyTo("reply@yourdomain.com", "Reply");

    $mail->isHTML(true);
    $mail->Subject = 'Winning submission #' . $uid; 

    // Get required email template
    $email_template = 'templates/default.html';
    $template = file_get_contents($email_template);

    // Build content variables
    $template = str_replace('*|UID|*', $uid, $template);
    $template = str_replace('*|FULLNAME|*', $name, $template);
    $template = str_replace('*|EMAIL|*', $email, $template);
    $template = str_replace('*|ADDRESS1|*', $address1, $template);
    $template = str_replace('*|ADDRESS2|*', $address2, $template);
    $template = str_replace('*|CITY|*', $city, $template);
    $template = str_replace('*|COUNTY|*', $county, $template);
    $template = str_replace('*|POSTCODE|*', $postCode, $template);
    $template = str_replace('*|MOBILENUMBER|*', $mobileNumber, $template);
    $template = str_replace('*|DELIVERYINSTRUCTIONS|*', $deliveryInstructions, $template);

    $mail->MsgHTML($template);

    try {
        $mail->send();
        echo "Message has been sent successfully";
    } catch (Exception $e) {
        echo "Mailer Error: " . $mail->ErrorInfo;
    }


Source