PHPMailer to SMTP transactional email authentication postmarkapp.com - 15/04/2025 12:56 EDT
Budget: $30 – $250 USD
REPOST - the contractor who set this up for us is no longer registered with FreeLancer. The script has been used very little since 2021. It has come to our attention that our new customer online-course delivery script DIES at this point.I've determined that the script runs until this is is called.
I have updated the requirement to PHP8x because I suspect that the cause of this issue is the PHP version in which it was written in 2021.
The original work was done for $100
--------------------------------------------------------------------------------------------------------------
Developing a PHP8x 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! Not interested on running on YOUR server.
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 PHP8x; (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.
The script below just stops when this code is "included".
The "Mailer Error: {$mail->ErrorInfo}";" does not print anything to the screen when run from a browser.
It just stops responding.
I put "print("progress report"); at various checkpoints in the script that calls this code, and it shows progress right up to the INCLUDE for this script.
EXISTING CODE AS OF 4/15/2025:
<?php
/* Namespace alias. */
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'vendor/autoload.php';
$mail = new PHPMailer( true );
try {
$mail->SMTPDebug = 0;
$mail->CharSet = "UTF-8";
$mail->isSMTP();
$mail->Host = 'smtp.postmarkapp.com';
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tls';
$mail->Username = '7b21f140-8132-4cdd-899a-89817e10b781';
$mail->Password = '7b21f140-8132-4cdd-899a-89817e10b781';
$mail->Port = 587;
$mail->setFrom( $set_from_email, $set_from_name );
$mail->addAddress( $set_to_email, $set_to_name );
$mail->addReplyTo( $set_replyto_email, $set_replyto_name );
if ( isset( $set_ccto_email )AND isset( $set_ccto_name ) ) {
$mail->addCC( $set_ccto_email, $set_ccto_name );
}
if ( isset( $set_bccto_email )AND isset( $set_bccto_name ) ) {
$mail->addBCC( $set_bccto_email, $set_bccto_name );
}
$mail->isHTML( true );
$mail->Subject = $set_mailsubject;
$mailContent = $set_mailcontent;
$mail->Body = $mailContent;
if ( isset( $set_plaintxt_body ) ) {
$mail->AltBody = $set_plaintxt_body;
}
$mail->send();
$mail->smtpClose();
} catch ( Exception $e ) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
$mail->smtpClose();
}
?>
I have updated the requirement to PHP8x because I suspect that the cause of this issue is the PHP version in which it was written in 2021.
The original work was done for $100
--------------------------------------------------------------------------------------------------------------
Developing a PHP8x 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! Not interested on running on YOUR server.
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 PHP8x; (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.
The script below just stops when this code is "included".
The "Mailer Error: {$mail->ErrorInfo}";" does not print anything to the screen when run from a browser.
It just stops responding.
I put "print("progress report"); at various checkpoints in the script that calls this code, and it shows progress right up to the INCLUDE for this script.
EXISTING CODE AS OF 4/15/2025:
<?php
/* Namespace alias. */
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'vendor/autoload.php';
$mail = new PHPMailer( true );
try {
$mail->SMTPDebug = 0;
$mail->CharSet = "UTF-8";
$mail->isSMTP();
$mail->Host = 'smtp.postmarkapp.com';
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tls';
$mail->Username = '7b21f140-8132-4cdd-899a-89817e10b781';
$mail->Password = '7b21f140-8132-4cdd-899a-89817e10b781';
$mail->Port = 587;
$mail->setFrom( $set_from_email, $set_from_name );
$mail->addAddress( $set_to_email, $set_to_name );
$mail->addReplyTo( $set_replyto_email, $set_replyto_name );
if ( isset( $set_ccto_email )AND isset( $set_ccto_name ) ) {
$mail->addCC( $set_ccto_email, $set_ccto_name );
}
if ( isset( $set_bccto_email )AND isset( $set_bccto_name ) ) {
$mail->addBCC( $set_bccto_email, $set_bccto_name );
}
$mail->isHTML( true );
$mail->Subject = $set_mailsubject;
$mailContent = $set_mailcontent;
$mail->Body = $mailContent;
if ( isset( $set_plaintxt_body ) ) {
$mail->AltBody = $set_plaintxt_body;
}
$mail->send();
$mail->smtpClose();
} catch ( Exception $e ) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
$mail->smtpClose();
}
?>