Skip to content
victorbstan edited this page Feb 10, 2013 · 1 revision

Gotchas

If your cron reports errors like this:

A sender (Return-Path, Sender or From) required to send a message (ArgumentError)

You might have to specify return_path and sender in your mailer, even if you have your production environment configuration to send through an account like GMail.

default from: "Your Name <your.name@example.com>",
        return_path: 'your.name@example.com',
        sender: 'your.name@example.com'

In the context of a mailer:

class YourMailer < ActionMailer::Base
  helper :application
  default from: "Your Name <your.name@example.com>",
          return_path: 'your.name@example.com',
          sender: 'your.name@example.com'

  def your_mailer_email
    # your mailer logic
  end
end