10
電子メールに添付ファイルを追加したいとします。私はsfmailerクラスを使用しています。Symfonyの添付ファイルをメールに追加するには?
ここで私は以下の私のコードを与えている:
$mail_body = '<p>custom html mail content</p>';
$message = Swift_Message::newInstance('Message title')
->setFrom(array('sender'))
->setTo(array('receiver'))
->setBody($mail_body, 'text/html', 'utf-8');
try {
$this->getMailer()->send($message);
}
catch(Exception $e) {
}
http://swiftmailer.org/docs/messages.html#attaching-files – Adam