PHPMailer and PHP code correct?
Good day. I've looked around at answers most of the day and nothing is answering my questions. everyone adds the link to the PHPMailer file in GitHub and i cant even make sense of that. Let me say this now, I DON'T KNOW ANYTHING ABOUT PHP... But for this project i need the PHP script to email form submissions to an email address. I know the PHP code works but I've added the PHPMailer script in and I'm not sure if it's the correct thing to do... The form is on an additional html file that has a link to the php file using the action attribute. I know the php script works because it works 100% on my website but my father's host requires something about smtp, and that's where i go blank. What i did on the script is everything that i, sort of, understood, if that's even correct. Please let me know if i am correct. Thank you. <?php use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'path/to/PHPMailer/src/Exception.php'; require 'path/to/PHPMailer/src/PHPMailer.php'; require 'path/to/PHPMailer/src/SMTP.php'; $mail = new PHPMailer(true); // Passing `true` enables exceptions try { //Server settings $mail->SMTPDebug = 2; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'smtp1.example.com;smtp2.example.com'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'username'; // SMTP username $mail->Password = '******'; // SMTP password $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted $mail->Port = 25; // TCP port to connect to $webmaster_email = "sales@raincor.co.za"; $feedback_page = "feedback_form.html"; $error_page = "error_message.html"; $thankyou_page = "thank_you.html";