Have custom files that were using the old cEMail class and now am converting to requirementsbut keep receiving “Could not instantiate mail function.” - can’t figure out what is miss now. do I need to manually add the smtp account info from ewcfg15.php ?
$Email = new \PHPMailer\PHPMailer\PHPMailer();
$Email->isHTML(true);
$Email->setFrom($msgHeader['sender']); // Replace Sender
$Email->addAddress($msgHeader['recipient']); // Replace Recipient
$Email->Subject = $msgHeader['subject']; // Replace Subject
$Email->Body = $msgHeader['content'];
$bEmailSent = $Email->send();
if($bEmailSent) { ... }
added the following items but these items are not returning the correct data:ex:
Port: returns “PHPMaker2019\electron2\587”
Password: returns “PHPMaker2019\electron2\SMTP_SERVER_PASSWORD”$Email->SMTPAuth = true;
$Email->SMTPAutoTLS = true;
$Email->Port = PROJECT_NAMESPACE . SMTP_SERVER_PORT;
$Email->Host = PROJECT_NAMESPACE . ‘SMTP_SERVER’;
$Email->Username = PROJECT_NAMESPACE . ‘SMTP_SERVER_USERNAME’;
$Email->Password = PROJECT_NAMESPACE . ‘SMTP_SERVER_PASSWORD’;
$bConnected = $Email->smtpConnect();