Я хочу добавить вложение в электронное письмо. Я использую класс sfmailer.
Здесь я привел свой код ниже:
$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) {
}