优化发信附件name

no_ymq_dev
CGDF 8 years ago
parent eb24a832e4
commit 522ae69431

@ -33,7 +33,7 @@ class Mailgun extends Base
{
$inline=array();
foreach($files as $file){
array_push($inline,array('filePath'=>$file, 'filename'=>'attachment'));
array_push($inline,array('filePath'=>$file, 'filename'=>basename($file)));
}
if(count($inline)==0){
$this->mg->messages()->send($this->domain,[

@ -37,7 +37,7 @@ class SendGrid extends Base
$attachment = new \SendGrid\Attachment();
$attachment->setContent(base64_encode(file_get_contents($file)));
$attachment->setType("application/octet-stream");
$attachment->setFilename("backup.zip");
$attachment->setFilename(basename($file));
$attachment->setDisposition("attachment");
$attachment->setContentId("backup");
$mail->addAttachment($attachment);

Loading…
Cancel
Save