레일 2.3.5내 메일에 실제로 메일이 전송되지 않지만
이것은 내 지역에 있습니다.
나는 로그는 내가 내 콘솔에서 작업을 수행 할 수 있습니다 .. 외출라는 간단한 모델/뷰/컨트롤러에게#contact.rb
def deliver_contact
ContactMailer.deliver_contact(self)
end
#contacts_controller
def create
@contact = Contact.new(params[:contact])
respond_to do |wants|
if @contact.save
@contact.deliver_contact
#flash[:notice] = 'Contact was successfully created.'
wants.html { redirect_to('/thanks') }
else
wants.html { render :action => "new" }
end
end
을 가지고 있고 그것의 외출 말한다. 그러나 실제로받은 편지함에는 아무 것도 수신되지 않습니다. 내가 뭘 놓치고 있니? 여기에 업데이트
내 development.rb
입니다 :
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => '25',
:domain => "website.com",
:authentication => :login,
:user_name => "[email protected]",
:password => "aged-cheese"
}
만들기
Processing ContactsController#create (for 127.0.0.1 at 2010-11-28 16:12:49) [POST]
Parameters: {"commit"=>"PUNCH IT, CHEWY!", "action"=>"create", "authenticity_token"=>"3zayXGIOWeNLwb+jhx5cIxWgHqEJdv6iwj6I=", "contact"=>{"name"=>"bob marley", "message"=>"asdfasdf", "state_id"=>"Regarding an existing order", "email"=>"[email protected]"}, "controller"=>"contacts"}
Cache miss: Spree::Config ({})
Preference Load (0.3ms) SELECT * FROM "preferences" WHERE ("preferences".owner_id = 1 AND "preferences".owner_type = 'Configuration')
Configuration Load (0.1ms) SELECT * FROM "configurations" WHERE ("configurations"."id" = 1)
CACHE (0.0ms) SELECT * FROM "configurations" WHERE ("configurations"."id" = 1)
Cache write (will save 2.65ms): Spree::Config
Contact Create (0.8ms) INSERT INTO "contacts" ("name", "city", "zip", "created_at", "optin", "updated_at", "state_id", "message", "email") VALUES('bob marley', NULL, NULL, '2010-11-28 21:12:49', NULL, '2010-11-28 21:12:49', 'Regarding an existing order', 'asdfasdf', '[email protected]')
Sent mail to [email protected]
Date: Sun, 28 Nov 2010 16:12:50 -0500
From: [email protected]
To: [email protected]
Subject: HOLY [email protected] you got mail!
Mime-Version: 1.0
Content-Type: text/html; charset=utf-8
<strong>You have just received a dank crispy email.</strong>
<br />
<p>
Here are the details of the message:
</p>
<p>
<strong>Name:</strong>
bob marley
</p>
<p>
<strong>Email:</strong>
[email protected]
</p>
<p>
<strong>Subject:</strong>
Regarding an existing order
</p>
<p>
<strong>Message:</strong>
<br />
asdfasdf
</p>
Redirected to http://localhost:3000/thanks
Completed in 893ms (DB: 5) | 302 Found [http://localhost/contacts]
갱신 로그인 :
gmail tls 플러그인을 사용해 보았지만 작동하지 않았습니다. development.rb에 environment.rb로 설정을 옮겨 보았습니다.
나는 spree를 사용하고 있지만 환경 또는 development.rb에/config를 넣으면 Spree의 기본값보다 우선합니다. 또는 Spree의 관리자 내에서 메일 서버를 만들 수 있으며 올바른 사양으로 메일을 보낼 수 있습니다.
합니까 메일 전송 해당 시스템에서 모든 작업을? –
스팸 폴더를 확인 했습니까? – bitxwise
@martin, 네, 제 다른 응용 프로그램에서 사용합니다. --- @bitxwise, 그렇습니다. 아무 것도 없었습니다. – Trip