Hi there so the contact form for my site I am building for a client is hosted by godaddy and is returning an HTTP Error 500. I contacted them and they ran a test script saying everything works from their end. Also, they said that it works fine with either PHP or SMTP and that the issue revolves around the contact form script. I'm not sure what the issue could be as I followed the https://docs.semicolonweb.com/docs/forms/form-setup/
Here is the code for the contact form and form.php:
<div class="form-widget">
<div class="form-result"></div>
<form class="mb-0" id="template-contactform" name="template-contactform" action="include/form.php" method="post">
<div class="form-process">
<div class="css3-spinner">
<div class="css3-spinner-scaler"></div>
</div>
</div>
<div class="row">
<div class="col-12 form-group mb-4">
<label for="template-contactform-name">Name <small>*</small></label>
<input type="text" id="template-contactform-name" name="template-contactform-name" value="" class="form-control required">
</div>
<div class="col-12 form-group mb-4">
<label for="template-contactform-email">Email<small>*</small></label>
<input type="email" id="template-contactform-email" name="template-contactform-email" value="" class="required email form-control">
</div>
<div class="col-12 form-group mb-4">
<label for="template-contactform-message">Message <small>*</small></label>
<textarea class="required form-control" id="template-contactform-message" name="template-contactform-message" rows="4" cols="30"></textarea>
</div>
<div class="col-12 form-group mb-4 d-none">
<input type="text" id="template-contactform-botcheck" name="template-contactform-botcheck" value="" class="form-control">
</div>
<div class="col-12 form-group mb-0">
<button class="btn text-larger btn-dark bg-color px-4 py-2 rounded-pill" type="submit" id="template-contactform-submit" name="template-contactform-submit" value="submit"><i class="bi-envelope color-2 ms-1"></i> Send Message</button>
</div>
</div>
<input type="hidden" name="prefix" value="template-contactform-">
</form>
</div><?php
/*-------------------------------------------------
Form Processor Plugin
by SemiColonWeb
---------------------------------------------------*/
/*-------------------------------------------------
PHPMailer Initialization
---------------------------------------------------*/
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'phpmailer/src/Exception.php';
require 'phpmailer/src/PHPMailer.php';
require 'phpmailer/src/SMTP.php';
/*-------------------------------------------------
Receiver's Email
---------------------------------------------------*/
$toemails = array();
$toemails[] = array(
'email' => 'marylandib@gmail.com', // Your Email Address
'name' => 'Jordan' // Your Name
//);
/*-------------------------------------------------
Sender's Email
---------------------------------------------------*/
$fromemail = array(
'email' => 'no-reply@website.com', // Company's Email Address (preferably currently used Domain Name)
'name' => 'Company Name' // Company Name
);
/*-------------------------------------------------
reCaptcha
---------------------------------------------------*/
// Add this only if you use reCaptcha with your Contact Forms
$recaptcha_secret = ''; // Your reCaptcha Secret
/*-------------------------------------------------
hCaptcha
---------------------------------------------------*/
// Add this only if you use hCaptcha with your Contact Forms
$hcaptcha_secret = ''; // Your hCaptcha Secret
/*-------------------------------------------------
PHPMailer Initialization
---------------------------------------------------*/
$mail = new PHPMailer();
/* Add your SMTP Codes after this Line */
$mail->IsSMTP();
$mail->Host = "mail.yourdomain.com";
$mail->SMTPDebug = 0;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Port = 26;
$mail->Username = "yourname@yourdomain.com";
$mail->Password = "yourpassword";
// End of SMTP