title: Serve Static Images with Phoenix Elixir
body: <p>I am trying to deploy an API with Heroku, using Elixir and Phoenix. In some use cases, I need to send an HTML email (that is all figured out and sending properly), however, images used on the email body are not being sent. This images are under: <code>priv/static/images</code>.</p>
  
  <p>On the email body I am using: </p>
  
  <p><code>src="&lt;%= Routes.static_url(@conn, "/images/logo-default.png") %&gt;"</code> </p>
  
  <p>This works on development mode. Emails sent to <code>localhost:4000/sent-emails</code> render with the images. But in production, the emails sent, arrive to mailbox without them. </p>
  
  <p>If I lookup <code>localhost:4001/images/logo-default.png</code> (running locally) or in Heroku <code>https://agile-fortress-72183.herokuapp.com/images/logo-default.png</code> I can see the images. Either way none of them serves the images on email.</p>
  
  <p>I'm not using a Phoenix buildpack because the only files I want to serve are this images to be part of email HTML body.</p>
  
  <p><strong>[UPDATE]</strong></p>
  
  <p>After a while, and some research I noticed that the email clients are blocking the images. So, how do I send an html body email with images, like the ones on newsletters and so. I am using <code>Bamboo</code> adapter and <code>Mailgun</code> to send the emails.</p>
  
  <p>Any solutions to fix this problem?</p>