我在死衚衕!我正在嘗試製作一個應用程序來接收hotmail上的電子郵件!我在方法創建的方法和我收到一個錯誤,沒有電子郵件接收..如何接收來自Rails應用程序的紅寶石電子郵件
:
class Recivemail < ActiveRecord::Base
attr_accessible :content, :from, :subject
def sendmail(content,from,subject)
subject = 'subject'
recipients = "[email protected]"
from = 'from'
sent_on = Time.now
end
end
在配置> enviroments> development.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings ={
:enable_starttls_auto => true,
:address => 'smtp.hotmail.com',
:port => 587,
:authentication => :plain,
:domain => 'localhost:3000',
:user_name => '[email protected]',
:password => 'mypass'
}
的意見> recivemails
>顯示
<%[email protected](@recivemail.from,@recivemail.subject,@recivemail.content)%>
一切似乎工作正確除了我沒有收到任何電子郵件 任何想法?
大聲笑,所以noobish!我正在努力學習ror! thx這是正確的:)) 但仍然沒有電子郵件接收.. – marios
令人困惑的是,你有一個名爲'ReceiveMail'的類中稱爲'sendmail'的方法。我不完全確定你要完成什麼,因爲看起來你只是在探索Rails,所以我想幫助解決跳出我的問題。 – jdl
我想製作一個應用程序,用戶可以給我發電子郵件..我必須下載actionmailer包裝?我不知道爲什麼現在不工作,現在我修復了這個問題... – marios