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 6795229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:19:06+00:00 2026-05-26T18:19:06+00:00

I have an ActionMailer controller that’s supposed to send this file: /user_mailer/welcome_email.text.erb This is

  • 0

I have an ActionMailer controller that’s supposed to send this file:

/user_mailer/welcome_email.text.erb

This is the (sample) content of the file:

Welcome to znood.com, <%= @user.name %>

You have successfully signed up to znood.com,
Your username is: <%= @user.email %>.

To login to the site, just follow this link: <%= @url %>.

Thanks for joining and have a great day!

The Znood Team

[edited]
This is the code in the controller:

def sendmail
        @user = User.first
        UserMailer.welcome_email(@user).deliver
        render "user_mailer/welcome_email.text"
        #render the file to see what we're supposed to send
end

and this is the code in UserMailer < ActionMailer::Base

 def welcome_email(user)
    @user = user
    @url  = "http://znood.com/"
    mail(:to => user.email, :subject => "Welcome to Znood!") 
  end

This is the email I’m receiving:

Welcometoznood.com,AbdoAchkarYouhavesuccessfullysigneduptoznood.com,Yourusernameis:blabla.Tologintothesite,justfollowthislink:http://znood.com/.Thanksforjoiningandhaveagreatday!TheZnoodTeam

Any clue how to include the spaces, carriage returns and line feeds?

[edit]
After installing the letter_opener gem, I see the following in my console:

----==_mimepart_4ea9882a2735c_1c782d964bc18193

Date: Thu, 27 Oct 2011 19:34:50 +0300

Mime-Version: 1.0

Content-Type: text/plain;

 charset=UTF-8

Content-Transfer-Encoding: 7bit

Content-ID: <4ea9882a2d8ee_1c782d964bc18277@lenovo-PC.mail>



Welcometoznood.com,AbdoAchkarYouhavesuccessfullysigneduptoznood.com,Yourusername
is:blabla.Tologintothesite,justfollowthislink:http://znood.com/.Thanksforjoiningandhaveagreatday!TheZnoodTeam

I attempting changing the “Content-Transfer-Encoding” headers but they don’t seem to change. I also tried setting a default value for it. It looks like we’re stuck with 7bit encoding.

[Edited]
Another that should help us find the problem is that I tried passing the following params to the mail function in order to see whether the file renderer is problematic:

   mail(:to => user.email, :subject => "Welcome to Znood!") do |format|
        #format.text(:content_transfer_encoding => "base64")
        format.text { render :text => "Hello there!" }
    end

“Hellothere!” also came out collated.

I then tried the code below to make sure whether it’s the render or mail function that’s causing the errors.

mail(:to => user.email, :subject => "Welcome to Znood!") do |format|
        format.text { "hello there!" }
end

Also came out collated.

  • 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-05-26T18:19:07+00:00Added an answer on May 26, 2026 at 6:19 pm

    This took me a while to resolve. The problem wasn’t with ActionMailer.

    If you’re having this problem, first make sure it’s not your code or gems causing this. Start a new rails application and test ActionMailer with it. (Thanks for @RubyCyanide for this suggestion)

    In my case, it was a function join that I had in my String class initializer. It’s very probable that you or a gem that you’re using is conflicting with Mail’s join function.

    Hope this helps!

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

Sidebar

Related Questions

I have a rails code that sends emails. Following is in my controller: def
I have a Rails app (2.3.8) where I send emails using ActionMailer from my
I have a simple ActionMailer class like this: class MyMailer < ActionMailer::Base def mail(from,
I have an ActionMailer observer that's working just fine during normal sends, but when
I have an ActionMailer class class UserMailer < ActionMailer::Base default from: no-reply@spicy-millennium.com def submission_reminder
have written this little class, which generates a UUID every time an object of
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
I have an ActionMailer Model (Notifier) and a view for the mail. In my
I know that this is a simple question and asked by many more many
I am getting an EOFError (End Of File Error) on this code in my

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.