没有找到Swift Mailer Swift_Attachment类

I am attaching PDF into email, PDF is generated through mPDF and it's generated perfectly. But when I try to attach it into email using Swift Mailer it's always giving me class error that Swift_Attachment class not found

Code

require __DIR__.'/swiftmailer/lib/classes/Swift.php';

$attachment = new Swift_Attachment($html, 'phpflow.pdf', 'application/pdf');

$message = Swift_Message::newInstance()
  ->setSubject('Here is the subject')
  ->setFrom(array('john@doe.com' => 'John Doe'))
  ->setTo(array('acb@gmail.com'))
  ->setBody('Here is the message itself')
  ->attach($attachment);

$transport = Swift_MailTransport::newInstance();
$mailer = Swift_Mailer::newInstance($transport);
$mailer->send($message);
$mpdf->Output($filename ,'I');

I don't know what's wrong here, suggest me

php
doushan3511
doushan3511 怎么做?
一年多之前 回复
drzablspw01655860
drzablspw01655860 为什么不使用打印调试来查看您的依赖项是否实际导入正确?
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐