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

  • Home
  • SEARCH
  • 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 7810329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:44:17+00:00 2026-06-02T03:44:17+00:00

i am using rails3.0.6 and ruby 1.8.7, i can easily send email from my

  • 0

i am using rails3.0.6 and ruby 1.8.7, i can easily send email from my applications development mode.But last night i saw a new error when i tried to send mail to my customers email which is polymorphic associated with my invoice model. The error is:

Net::SMTPSyntaxError in InvoicesController#email_invoice 
501 < @invoice.account.accountable.email >: missing or malformed local part

My code for email.rb file is :

 def send_invoice(invoice)
   email = '@invoice.account.accountable.email'
   mail(:to => email, :from => "support@thenextwave.in", :subject=>"Invoice, check it.") 
 end

and in my invoice controller i did:

def email_invoice
  @company = Company.find(User.find(session[:current_user_id]))
  @invoice = Invoice.find(params[:id])
  @invoice_line_items = @invoice.invoice_line_items
  @receipt_vouchers = @invoice.receipt_vouchers
  #email = @invoice.account.accountable.email
  Email.send_invoice(@invoice).deliver
  redirect_to invoice_path(@invoice)
  flash[:success] = 'Email has been sent successfully.'
end

i goggled for this error and find that it causes due to wrong from and to email addresses or wrong SMTP settings, but my SMTP setting is ok since i can send email from my application but has problem with below line:

@invoice.account.accountable.email

any help would be thaknful..

  • 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-02T03:44:19+00:00Added an answer on June 2, 2026 at 3:44 am

    I come up with a solution, I made mistake in email.rb file in my mailer :

    def send_invoice(invoice)
      email = '@invoice.account.accountable.email'
      mail(:to => email, :from => "support@thenextwave.in", :subject=>"Invoice, check it.") 
    end
    

    it should be:

    def send_invoice(invoice)
      email = invoice.account.accountable.email 
      mail(:to => email, :from => "support@thenextwave.in", :subject=>"Invoice, check it.") 
    end
    

    Now I can send email easily..

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

Sidebar

Related Questions

I'm using Ruby on Rails to make an application where businesses can create accounts
I'm working on an IMAP client using Ruby and Rails. I can successfully import
I'm creating a website in Ruby on Rails, where users can login using RESTful
Using Ruby on Rails, how can I achieve a polymorphic has_many relationship where the
I want to create a login page, it can easy implement using Ruby on
When working in Ruby (specifically, in Rails), I can automatically run my tests using
First of all, I'm using Rails3 with Ruby 1.9.2. I have a problem using
I was using NetBeans but it seems that support for Ruby is officially dead
I'm accessing the Amazon AWS API using the ruby-aaws gem, but without going to
I am using Ruby on Rails 3.2.2 and I would like to easily /

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.