2011-02-06 66 views
1

這是我第一個使用RefineryCMS的應用程序。過去我從應用程序發送郵件的方式目前不適用於我的煉油廠應用程序。SendGrid不會從默認的聯繫方式發送Heroku上的郵件

我已經嘗試了許多方式,通過在互聯網上的衆多搜索方式做到這一點,我無法做到這一點。

目前,這裏是我有:

environment.rb文件我有這樣的:

config.action_mailer.smtp_settings = { 
    :enable_starttls_auto => true, 
    :address  => 'smtp.sendgrid.net', 
    :port   => '25', 
    :authentication => :plain, 
    :user_name  => '[email protected]', 
    :password  => 'mypassword', 
    :domain   => 'mydomain' 
    } 

我也曾嘗試:

ActionMailer::Base.smtp_settings = { 
    :enable_starttls_auto => true, 
    :address  => 'smtp.sendgrid.net', 
    :port   => '25', 
    :authentication => :plain, 
    :user_name  => '[email protected]', 
    :password  => 'mypassword', 
    :domain   => 'mydomain' 
    } 

我試圖把這些設置在生產和發展班。嘗試本地和heroku,但我不能得到內置的查詢/聯繫表格發出通知郵件,我不知道爲什麼它不會工作。

就像我剛纔所說的,我已經嘗試了每個解決方案(他們都非常相似),我可以找到這個,但不能使其工作。如果有人能說出我做錯了什麼,確切地說,這是我需要做的,那真是太棒了。

由於提前, 〜麥克

+1

除了你的第二次嘗試,你把:ActionMailer :: Base.delivery_method =:smtp ActionMailer :: Base.perform_deliveries = true – apneadiving 2011-02-06 22:52:14

回答

6

其實,這是在refinerycms-inquiries現有版本是造成郵件無法發送的錯誤。一旦我更新到0.9.9.9,它按預期工作。如果任何人都需要知道如何執行此更新:

首先,這一行添加到您的寶石文件:

gem 'refinerycms-inquiries', '~> 0.9' 

然後運行這個命令:

bundle update refinerycms-inquiries 

,這就是我添加到environment.rb文件中:

ActionMailer::Base.smtp_settings = { 
    :enable_starttls_auto => true, 
    :address  => 'smtp.sendgrid.net', 
    :port   => '25', 
    :authentication => :plain, 
    :user_name  => '[email protected]', 
    :password  => 'mypassword', 
    :domain   => 'mydomain.com' 
} 

就是這樣。

相關問題