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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:38:09+00:00 2026-05-30T14:38:09+00:00

Looks like my emails raising errors and sending. I’m receiving emails and also I

  • 0

Looks like my emails raising errors and sending.

I’m receiving emails and also I get this error on “rake jobs:work” console:

Class#deliver_and_save failed with ArgumentError: A sender (Return-Path, Sender or From) required to send a message – 1 failed attempts

But when I step through my debugger, I can see that there is a from:

> email.from
=> ["my@email.com"]
> email_draft.From
=> Me <my@email.com>
> email_draft.sender
=> nil
> email_draft.Sender
=> nil
> email_draft.reply_to
=> ["my@email.com"]

Is it possible that ActionMailer is throwing the error and still sending? Is this a known issue? The problem I have is that delayed_job keeps sending the email repeatedly.

UPDATE:

def EmailEngine < ActionMailer::Base

  # Called with EmailEngine.delay.deliver_and_save(template)
  def deliver_and_save(template)

    # This appears to be raising the error
    email_draft = EmailEngine.send(template) # this will invoke 'mail'

    # Saved here to have a better record than the logs provide
    Email.create(...

    # Yet this still sends
    email_draft.deliver
  • 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-30T14:38:11+00:00Added an answer on May 30, 2026 at 2:38 pm

    Found the problem!

    delayed_job doesn’t play super well with rails 3.1 and you have to use this new syntax:

    EmailEngine.delay.deliver_and_save(template) # I was already doing this.
    

    which it automatically tries to calls .deliver on the Mail::Message object that deliver_and_save returns. (So there’s my problem: trying to call .deliver myself.)

    SOLUTION: I rearranged my code and to call Email.create(.. somewhere outside of EmailEngine and then I called EmailEngine.delay.send(template) directly and completely removed deliver_and_save.

    Woo!

    Btw, any method invoked on a class that inherits from ActionMailer will return a Mail::Message object. ActionMailer does some black magic to make this happen (overwriting Ruby’s method_missing so it can render views just like a controller, even though it behaves like a model in many ways).

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

Sidebar

Related Questions

Looks like send.php is being accessed and sending blank emails. Need to make it
I'm using openURL to send an email w/some links. The function looks like this:
It looks like IIS httpCompression compresses your files. If this compression is in place,
I have a generic Logger class that looks like this: class Logger { ...
I have a Transfer class, simplified it looks like this: public class Transfer {
I have a simple gridview ItemTemplate that looks like this: <asp:TemplateField HeaderText=User> <ItemTemplate> <a
So I've built this mail-program-like HTML viewer (no real emails, just some messages from
i have generated a Linq to Sql class which looks like this. so i
Looks like while( condition ) { //do stuff } is completely equivalent to for(
Looks like ExpressionTrees compiler should be near with the C# spec in many behaviors,

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.