我正在尝试使用 mailgun 发送电子邮件并发送正文消息 url-to 以上传用户文件夹中的文件...问题是我不知道如何捕获目录中的所有文件并显示是否喜欢链接(下载它) .. 这是我试图用代码做的事情:
$uploadsDir = 'https://lionbg.net/careers-test/upload'.$folderName.'/';
$first_char = mb_substr($jsonDecode["firstName"], 0, 1);
$directory = "upload/".$folderName."";
$filesInFolder = glob($directory . "/*.jpg");
$files = array();
foreach($filesInFolder as $filename){
//Simply print them out onto the screen.
//$files = "<a href='".$uploadsDir.$filename"' target='_blank'>".$filename.'</a>';
$result = array_merge($result, $filename);
}
$mg->sendMessage($domain, array(
'from' => 'from-email@gmail.com',
'to' => 'to@gmail.com',
'subject' => 'New applicant',
'text' => ''.$result.''
));
慕标5832272