No. If your path is correct, you should work.
I do not know the whole of your code, so I’ll post my code that has been working for several years.
It is used in a blank app. Sends to several email addresses and add a * .pdf document as an attachment.
Regards,
sc_include_library(“prj”, “PHPMailer”, “src/PHPMailer.php”, true, true);
sc_include_library(“prj”, “PHPMailer”, “src/Exception.php”, true, true);
sc_include_library(“prj”, “PHPMailer”, “src/SMTP.php”, true, true);
if(!empty({loc_email})){
$l_emails = {loc_email};
}
if(!empty({usr_send_email}) && !empty($l_emails)){
$l_emails .= “;”.{usr_send_email};
}elseif(!empty({usr_send_email}) && empty($l_emails)){
$l_emails = {usr_send_email};
}
$param_message= {lang_email_body};
if(!empty(trim($l_emails))){
try {
$mail = new PHPMailer\PHPMailer\PHPMailer;
$mail->IsSMTP();
$mail->SMTPDebug=0;
$mail->SMTPAuth= TRUE;
$mail->SMTPSecure=“ssl”;
$mail->Port=465;
$mail->CharSet = ‘UTF-8’;
$mail->Username="report@my-domain.com";
$mail->Password=“xxxxxxxxxx”;
$mail->Host=“reseller03.my-servername.com”;
$mail->Mailer=“smtp”;
$mail->SetFrom(“report@my-domain.com”,“MY Portal”);
$mail->AddReplyTo(“user.name@my-domain.com”,“User Name”);
$destinations = explode(';', $l_emails);
$n = 0;
foreach ($destinations as $destination){
if ($n==0) {
$mail->AddAddress($destination, $destination);
} else {
$mail->AddCC($destination, $destination);
}
$n++;
}
$mail->Subject= {lang_report1_name};
$mail->WordWrap=80;
$content = $param_message;
$mail->MsgHTML($content);
$mail->IsHTML(true);
$at_path=$this->Ini->path_doc;
$doc_name = {country_id_2}."-".{location_id}."-".[g_id];
$attch=$at_path."-".$doc_name.'.pdf';
$mail->AddAttachment($attch);
if (!$mail->Send()) {
echo $mail->ErrorInfo;
}
} catch (PHPMailer\PHPMailer\PHPMailerException $e) {
echo $e->errorMessage();
} catch (Exception $e){
echo $e->getMessage();
}
}