Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8652919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:25:05+00:00 2026-06-12T14:25:05+00:00

When I send an email with a attached pdf file the email only shows

  • 0

When I send an email with a attached pdf file the email only shows a file called ‘Noname’. The file itself is the multipart section of the email with the base64 attached pdf. How can I send the PDF so it comes up as an attachment and doesn’t corrupt the email?

Here is my code:

attachments['126539_statistics.pdf'] = File.read("app/assets/pdfs/126539_statistics.pdf")
mail(:to => email, :subject => subject, :body => message,  :content_type => 'application/pdf') 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:25:06+00:00Added an answer on June 12, 2026 at 2:25 pm

    I had face same problem. I have corrected it by following way

    1) As per ActionMailer Guide, You need to make view file into app/views/[action_mailer_model_name]/[method_name]

    Here is reference of guide: http://api.rubyonrails.org/classes/ActionMailer/Base.html

    2) Action Mailer is smart enough that it identify content-type automatically while reading file. So there is no need to pass explicitly ‘application/pdf’ in your mail function.

    Hope, this information helps to solve your problem

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My goal is to send an email with a generated pdf file attached to
I am trying to send an email with an attached file to it but
I'm trying to send an email with an excel file attached using smtplib in
Possible Duplicate: how to send email with attached file in android? When I send
I'm trying to send email with some images attached in django. Code used is
Is it best practice to send both HTML and Text email? If I only
I want to send an email with some attached images. I also need to
We'd like to send a single email which has multiple contents attached. Scenario is
I am using cake php 2.0 version, I need to send a PDF attached
In my Android App I send email messages with images attached. Using the Intent

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.