1
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user