2011-04-03 16 views
6

मैंने एक कस्टम मेलर लिखा है जब उपयोगकर्ता को कोई सूचना प्राप्त होती है तो एक ईमेल भेजता है। किसी कारण से कस्टम मेलर काम करता है लेकिन निर्मित मेलर में निर्मित काम नहीं करता है। मैं पुष्टिकरण ईमेल भेजने में सक्षम नहीं हूंईमेल भेजने के लिए तैयार करने के लिए

मेरी कॉन्फ़िगरेशन में कुछ याद आ रही है?

-devise.rb:

config.mailer_sender = "[email protected]" 

-setup_mail.rb:

require "development_mail_interceptor" 

ActionMailer::Base.smtp_settings = { 
    :address    => "smtp.gmail.com", 
    :port     => 587, 
    :domain    => "gmail.com", 
    :user_name   => "usename", 
    :password    => "pass", 
    :authentication  => "plain", 
    :enable_starttls_auto => true 
} 



ActionMailer::Base.perform_deliveries = true 
ActionMailer::Base.raise_delivery_errors = true 
ActionMailer::Base.register_interceptor(DevelopmentMailInterceptor) if Rails.env.development? 
+0

क्या त्रुटियों/अपवाद मिल रहा है? –

+0

कोई नहीं, विकास लॉग लिखता है कि ईमेल भेजा गया था लेकिन मुझे इसे कभी भी प्राप्त नहीं हुआ – Gady

+0

तब यह कहां समाप्त होता है? क्या सिस्टम कभी नेटवर्क पर 'smtp.gmail.com' से बात करता है? क्या आप किसी भी तरह त्रुटि लॉगिंग स्तर बढ़ा सकते हैं? –

उत्तर

4

मुझे विश्वास है कि

में देख

config/initializers/devise.rb

टी नहीं करेगा वह आप के लिए चाल:

config.mailer = "वसीयत :: मेलर"

आप इसे uncomment कर सकते हैं!

1
This can be helpful. After r&D, the final complete text is below: 

# ActionMailer Config in development/production rb file 
    config.action_mailer.default_url_options = { :host => 'localhost:3000' } 
    config.action_mailer.delivery_method = :smtp 
    # change to true to allow email to be sent during development 
    config.action_mailer.perform_deliveries = true 
    config.action_mailer.raise_delivery_errors = true 
    config.action_mailer.default :charset => "utf-8" 

    config.action_mailer.smtp_settings = { 
    address: "smtp.gmail.com", 
    port: 587, 
    domain: "mail.google.com",####important 
    authentication: "plain", 
    enable_starttls_auto: true, 
    user_name: ENV["GMAIL_USERNAME"], 
    password: ENV["GMAIL_PASSWORD"] 
    } 
0

मैं आज एक मुद्दा पकड़ने और मैं इस पर 5 घंटे खर्च करते हैं। पुष्टि की टोकन रिक्त कॉलम खाली होने पर डेविस की पुष्टि ईमेल काम नहीं कर सकता है। वैसे जब कॉलम शून्य है तो यह अच्छी तरह से काम करता है।

#this works well 
add_column :users, :confirmation_token, :string 
add_column :users, :confirmed_at, :datetime 
add_column :users, :confirmation_sent_at, :datetime 
add_column :users, :unconfirmed_email, :string 

#But this cannot work !!! 
add_column :users, :confirmation_token, :string, :null => false, :default => '' 
add_column :users, :confirmed_at, :datetime, :null => false, :default => '1970-01-01' 
add_column :users, :confirmation_sent_at, :datetime, :null => false, :default => '1970-01-01' 
add_column :users, :unconfirmed_email, :string, :null => false, :default => '' 

आशा मदद यू इस मुद्दे को समान रूप से पकड़ने जब। ~

संबंधित मुद्दे