This commit is contained in:
wangjinlei
2022-11-23 14:48:15 +08:00
parent 0a92e69b83
commit ec59e99a8b
636 changed files with 59164 additions and 46329 deletions

View File

@@ -78,16 +78,18 @@ function sendEmail($email = '', $title = '', $from_name = '', $content = '', $me
$mail->msgHTML($content);
//Replace the plain text body with one created manually
$mail->AltBody = '';
// if (is_array($attachmentFile)) {
// for ($i = 0; $i < count($attachmentFile); $i++) {
// $mail->addAttachment($attachmentFile[$i], 'thanks' . $i.'.jpg'); //这里可以是多维数组,然后循环附件的文件和名称
// }
// } else {
if (is_array($attachmentFile)) {
for ($i = 0; $i < count($attachmentFile); $i++) {
if($attachmentFile[$i]!=''){
$mail->addAttachment($attachmentFile[$i],substr($attachmentFile[$i],strrpos($attachmentFile[$i],DS)+1)); //这里可以是多维数组,然后循环附件的文件和名称
}
}
} else {
if ($attachmentFile != '') {
//Attach an image file
$mail->addAttachment($attachmentFile, substr($attachmentFile,strrpos($attachmentFile,DS)+1));
}
// }
}
//send the message, check for errors
if (!$mail->send()) {
$status = 0;