2016-03-28 8 views
1

私はhttps://github.com/JDutil/contact_usを使用してアプリケーションで連絡先の使用ページを作成しましたが、投稿を押すたびに電子メールが送信されたと表示されますが、そうではありません。誰が何をすべきか知っていますか?私はどのようにして私たちに連絡先フォームを作成しますか?

私はこの

# Use this hook to configure contact mailer. 
ContactUs.setup do |config| 

# ==> Mailer Configuration 

# Configure the e-mail address which email notifications should be sent from. If emails must be sent from a verified email address you may set it here. 
# Example: 
# config.mailer_from = "[email protected]" 
config.mailer_from = "[email protected]" 

# Configure the e-mail address which should receive the contact form email notifications. 
config.mailer_to = "[email protected]" 

# ==> Form Configuration 

# Configure the form to ask for the users name. 
config.require_name = true 

# Configure the form to ask for a subject. 
config.require_subject = true 

# Configure the form gem to use. 
# Example: 
# config.form_gem = 'formtastic' 
config.form_gem = 'simple_form_for' 
# Configure the redirect URL after a successful submission 
config.success_redirect = '/' 

# Configure the parent action mailer 
# Example: 
# config.parent_mailer = "ActionMailer::Base" 

end 

答えて

0

のように見えるために私contact_us.rbを変更しましたが、サーバー/開発環境は、メールサーバがインストールされているしていますか? そうでない場合は、Gmailなどの外部SMTPサーバーを使用できます。あなたのconfig/environments/development.rbまたは設定/環境/ production.rb`し、それに応じて値を調整中

置き、このコードを:

config.action_mailer.delivery_method = :smtp 
config.action_mailer.smtp_settings = { 
    address:    'smtp.gmail.com', 
    port:     587, 
    domain:    'example.com', 
    user_name:   '<username>', 
    password:    '<password>', 
    authentication:  'plain', 
    enable_starttls_auto: true } 

詳細:Action Mailer Configuration for Gmail

+0

私はdevelopment.rbにこのコードを使用して変更それに応じて私はまだそれを電子メールを送信することはできません。 –

関連する問題