1

When I send mail using swiftmailer, using files from other cloud services as attachments, as long as there are special characters, it will report this error:

Unable to open path "https://xxxxxx/1664960211LNW1344-88%%%
¥¥¥nylon12Elastane.pdf".

$email = (new Email())
    ->from(new Address($smtpUser,$res['nickName']))
    ->to(...$res['sMailRecipient'])
    ->subject($res['sMailTitle'])
    ->html($res['sContent']);
    //CC
    if(!empty($res['sMailCc'])) $email->cc(...$res['sMailCc']);
    //BCC
    if(!empty($res['mailBcc'])) $email->bcc(...$res['mailBcc']);
    //Is there an attachment
    if(!empty($res['mailFile'])){
    foreach($res['mailFile'] as $f){
        $email->attachFromPath($f['sFiles'],$f['sFilesName']);
    }
}
ADyson
  • 57,178
  • 14
  • 51
  • 63
Li Halten
  • 11
  • 2

0 Answers0