title: Embed function in swiftmailer not working
body: <p>I want to send logo of our company in email inline &amp; not as attachment. I have this code for sending out email.</p>
  
  <pre><code>$transport = Swift_SmtpTransport::newInstance('hostname', port, 'ssl')
      -&gt;setUsername('email')
      -&gt;setPassword('password');
  
  $mailer = Swift_Mailer::newInstance($transport);
  $message = Swift_Message::newInstance('Subject')
      -&gt;setFrom(array('example@example.com' =&gt; 'example'))
      -&gt;setTo($email)
      -&gt;setBody('
  &lt;html&gt;
  &lt;body&gt;
    &lt;img src="' . $message-&gt;embed(Swift_Image::fromPath('images/maillogo.jpg')) . '" /&gt;
    &lt;p align="left"&gt; Greetings, &lt;/p&gt;
    &lt;br&gt;
    &lt;p align="left"&gt; Dear ' . $firstname . '
    &lt;p align="left"&gt; Your order ' . $orderid . ' has been placed with us. Kindly expect the delivery before 9pm.&lt;/p&gt;
    &lt;br&gt;
    &lt;p align="left"&gt; Thank you for Shopping with us. Have a great day. &lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;',
      'text/html');
  
  $result = $mailer-&gt;send($message);
  </code></pre>
  
  <p>However I get this error</p>
  
  <p><code>Call to a member function embed() on a non-object.</code>
  Any idea how to resolve this? Looked at so many threads but couldn't get an answer.</p>
  
  <p>I tried this method as well but it send an email with attachment &amp; not logo in the first line.</p>
  
  <pre><code>-&gt;attach(Swift_Attachment::fromPath('path to image here.jpg')  
  -&gt;setDisposition('inline'));
  </code></pre>
  
  <p>Any suggestions or something?</p>