title: how to add an attachment to an email in Symfony?
body: <p>I want to add an attachment to an email. I am using sfmailer class.</p>
  
  <p>Here I have given my code below:</p>
  
  <pre><code>$mail_body = '&lt;p&gt;custom html mail content&lt;/p&gt;';
  $message = Swift_Message::newInstance('Message title')
    -&gt;setFrom(array('sender'))
    -&gt;setTo(array('receiver'))
    -&gt;setBody($mail_body, 'text/html', 'utf-8');
  
  try {
    $this-&gt;getMailer()-&gt;send($message);
  }
  catch(Exception $e) {
  
  }
  </code></pre>