This commit is contained in:
wangjinlei
2022-01-27 18:15:57 +08:00
parent ef83ab3a90
commit a8c7238a78
6 changed files with 88 additions and 12 deletions

View File

@@ -72,12 +72,12 @@ function sendEmail($email = '', $title = '', $from_name = '', $content = '', $me
$mail->AltBody = '';
if (is_array($attachmentFile)) {
for ($i = 0; $i < count($attachmentFile); $i++) {
$mail->addAttachment($attachmentFile[$i], 'thanks.pdf' . $i); //这里可以是多维数组,然后循环附件的文件和名称
$mail->addAttachment($attachmentFile[$i], 'thanks.jpg' . $i); //这里可以是多维数组,然后循环附件的文件和名称
}
} else {
if ($attachmentFile != '') {
//Attach an image file
$mail->addAttachment($attachmentFile, 'thanks.pdf');
$mail->addAttachment($attachmentFile, 'thanks.jpg');
}
}
//send the message, check for errors