PHPMailer to SMTP transactional email authentication postmarkapp.com

Job ID: 30870698

Budget: $30 – $250 USD

Developing a PHP7.4 script that can send a *low volume* of authenticated transactional emails to improve deliverability to our *customers*.

NOTE WELL: this is NOT a marketing email list sending project. Not spamming!

Objective: Functioning PHP script using PHPMailer.php and associated files
Server: IONOS managed server - with NO root access
External SMTP: postmarkapp.com transactional email authentication
Requirements:
use PHP7.4; (or PHP7.x if PHPMailer needs a retrograde version)
use PHPMailer.php (available from github);
use hosted postmarkapp SMTP;
I have written a test script and failed to get through a single execution to connect with the postmarkapp SMTP. The PHPMailer.php script throws errors in abundance.

I expect that the errors result from a faulty configuration. For instance, I have no idea what this does:
namespace PHPMailer\PHPMailer;

This may be a no-brainer for a real developer, but I'm willing to pay for a minimum of 4 hours to deliver a working prototype that I can incorporate into my working scripts that use mail(); sucessfully.

example code snipit:
include_once ('PHPMailer.php');
$mail = new PHPMailer();

// Content
$mail->setFrom('xyz@foo. bar', 'Mary');
$mail->addAddress('admin@foo. bar', 'Craig Reynolds');
$mail->addReplyTo('support@foo. bar', 'Reply To');
$mail->addCC('theboss@foo. bar', 'CC recipient');
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Test email subject';
$mailContent = "<h1>I Can Send HTML Email using SMTP in PHP!</h1>
<p>This is a test email I’m sending using SMTP mail server with PHPMailer.</p>";
$mail->Body = $mailContent;
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

if($mail->send()){
echo 'Message has been sent';
}else{
echo 'Message could not be sent.';
echo '<br>';
echo 'Mailer Error: ' . $mail->ErrorInfo;
}
$mail->smtpClose();
?>
Related categories: PHP Email Handling Email Developer SMTP