title: Email Attachments not working with Postmark
body: <p>I am using postmark to send email from the application. Its working fine for normal emails, but the email attachments are not working.</p>
  
  <p>It works fine on local, as on local i have the smtp+postmark settings (as to work it on local we need to have postmark along with smtp)</p>
  
  <p>But on staging and production am using only SMTP settings</p>
  
  <p><strong>config/environments/staging.rb</strong> and <strong>config/environments/production.rb</strong></p>
  
  <pre><code>POSTMARK_API_KEY = "&lt;my-api-key&gt;"
  config.action_mailer.delivery_method = :postmark
  config.action_mailer.postmark_settings = { :api_key =&gt; POSTMARK_API_KEY }
  </code></pre>
  
  <p><strong>config/environments/development.rb</strong></p>
  
  <pre><code>POSTMARK_API_KEY = "&lt;my-api-key&gt;"
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    :address              =&gt; "smtp.postmarkapp.com",
    :port                 =&gt; 25,
    :domain               =&gt; 'example.com',
    :user_name            =&gt; POSTMARK_API_KEY,
    :password             =&gt; POSTMARK_API_KEY,
    :authentication       =&gt; 'plain',
    :enable_starttls_auto =&gt; true  }
  </code></pre>
  
  <p><strong>user_mailer.rb</strong></p>
  
  <pre><code>class UserMailer &lt; ActionMailer::Base
    default from: DEFAULT_EMAIL
  
    def send_request(params, attachment)
       if attachment.present?
         mime_type = MIME::Types.type_for(attachment).first
         attachments["#{attachment.split('/').last}"] = { mime_type: mime_type,
           content: attachment, encoding: 'base64' }
       end
  
       mail(
         to:       &lt;some_email&gt;,
         subject:  "Refer Request",
         tag:      "refer_request")
    end
  </code></pre>
  
  <p>Here <code>attachment</code> is the url of file saved on S3.
  In development mode i receive email with attachment.
  but not in staging and development mode.</p>
  
  <p>Any help or suggestions would be appreciated. Thanks.</p>