Rails 3 ActionMailer - нет адреса получателя - PullRequest
1 голос
/ 18 сентября 2011

У меня проблема с моим продуктом actionmailer.Я размещен на site5, разделяя облако.Проблема в том, что я получаю это сообщение об ошибке.

A message that you sent using the -t command line option contained no
addresses that were not also on the command line, and were therefore
suppressed. This left no recipient addresses, and so no delivery could
be attempted.

------ This is a copy of your message, including all the headers. ------

Date: Sat, 17 Sep 2011 21:06:42 +0000
From: noreply@mydomain.com
To: myemail@mydomain.com
Message-ID: <4e750be27b3ef_4a9c159402ee91b039763@themailserver.com>
Subject: test
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit

я добавил значение по умолчанию

default :recipient => 'noreply@mydomain.com'

, но почта возвращает мне ту же ошибку.

мой контроллер ActionMailer

class Emailtousers < ActionMailer::Base
  default :from => "noreply@mydomain.com"
  default :recipient => "noreplay@mydomain.com"
  def plan_notification(resource)
    @resource = resource
    puts resource
    mail(:to => "myemail@mydomain.com", :subject => 'test')
  end
end

Что я пропустил?

Я последовал этому, чтобы помочь мне http://edgeguides.rubyonrails.org/action_mailer_basics.html

1 Ответ

6 голосов
/ 19 июля 2012

Я получил эту проблему, используя: метод доставки sendmail с exim.Добавление этого в config / application.rb исправило это для меня:

config.action_mailer.sendmail_settings = { :arguments => "-i" }

Я нашел решение в https://github.com/mikel/mail/issues/70#issuecomment-2639987

...