2016-03-28 16 views
1

Uygulamamda bir iletişim sayfası oluşturmak için https://github.com/JDutil/contact_us'u kullanmaya başladım, ancak her basışımda bir e-posta gönderdiğini ama olmadığını söyledi. Herhangi biri ne yapacağını biliyor mu?Raylardaki yakutta nasıl bir iletişim formu oluşturabilirim?

ben sunucu/geliştirme ortamı posta sunucusu yüklediği mu bu

# 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 

cevap

0

gibi görünmek benim contact_us.rb değiştirdik? Değilse, Gmail gibi harici SMTP sunucusunu kullanmayı deneyebilirsiniz.

yerleştirin config/environments/development.rb veya yapılandırma/ortamlarda/production.rb` bu kod ve buna göre değerleri ayarlayın:

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 } 

Detayları: Action Mailer Configuration for Gmail

+0

benim development.rb Bu kodu kullandıktan sonra değişiklikler buna göre değerler ancak hala bir e-posta göndermek için alamıyorum. –

İlgili konular