2012-12-12 21 views
12

कोई भी एक जोहो खाते के माध्यम से ईमेल भेजने के लिए ActionMailer को विन्यस्त भाग्य है? .deliver बार बाहर बुलारेल ActionMailer विन्यास के लिए जोहो

ActionMailer::Base.smtp_settings = { 
    :address    => "smtp.zoho.com", 
    :port     => 465, 
    :domain    => 'example.com', 
    :user_name   => '[email protected]', 
    :password    => 'n0tmypa$$w0rd', 
    :authentication  => :login 
} 

हालांकि,:

ये मेरा सेटिंग कर रहे हैं

irb(main):001:0> AdminMailer.signup_notification('asfd').deliver 
Timeout::Error: Timeout::Error 
     from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill' 
     from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:140:in `rbuf_fill' 
     from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil' 
     from C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:132:in `readline' 
     from C:/Ruby193/lib/ruby/1.9.1/net/smtp.rb:929:in `recv_response' 
     from C:/Ruby193/lib/ruby/1.9.1/net/smtp.rb:552:in `block in do_start' 
     from C:/Ruby193/lib/ruby/1.9.1/net/smtp.rb:939:in `critical' 
     from C:/Ruby193/lib/ruby/1.9.1/net/smtp.rb:552:in `do_start' 
     from C:/Ruby193/lib/ruby/1.9.1/net/smtp.rb:519:in `start' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mail-2.4.4/lib/mail/network/delivery_methods/smtp.rb:144:in `deliver!' 

help docs पोर्ट 465 और एसएसएल प्रमाणीकरण का उपयोग करने के लिए कहते हैं। मैंने :enable_starttls_auto => true के साथ और बिना प्रयास किया है लेकिन यह अभी भी समय समाप्त हो गया है।

>  Email Address: [email protected] 
>  User Name format: [email protected] 
>  Secure Connection (SSL) Yes 
>  Outgoing Mail Server Name: smtp.zoho.com 
>  Outgoing Port No.: 465 
>  Outgoing Mail Server requires authentication: Yes 

कोई भी विचार:

विशेष रूप से, docs निम्न सेटिंग निर्दिष्ट?

पेज। मैंने Outlook को help docs में सेटिंग्स का उपयोग करने के लिए कॉन्फ़िगर किया है और आउटगोइंग ईमेल ठीक काम करता है। smtp.zoho.com 465 के लिए टेलनेट भी कनेक्ट करता है।

+0

आप अपने स्थानीय होस्ट से कोशिश कर रहे हैं ??? – Jean

+0

मैं हूं, हालांकि निश्चित रूप से एसएमटीपी सर्वर दूरस्थ है (zoho.com)। क्या इससे कोई फर्क पड़ता है? ईमेल क्लाइंट (दृष्टिकोण) एक ही सेटिंग्स के साथ एक ही स्थानीय होस्ट पर भी है .. – lambinator

+0

सुनिश्चित नहीं हैं कि आप Outlook का उपयोग करने के लिए Microsoft अनुप्रयोगों से बाहर जाने वाले मेल को नज़रअंदाज़ नहीं लगती चाहते हैं - यहां तक ​​कि ईमेल पुष्टिकरण आवश्यक चीजों के लिए। – Noz

उत्तर

29
# Action Mailer 
ActionMailer::Base.delivery_method = :smtp 
ActionMailer::Base.smtp_settings = {    
    :address    => "smtp.zoho.com", 
    :port     => 465,     
    :user_name   => '[email protected]', 
    :password    => 'password',   
    :authentication  => :login, 
    :ssl     => true, 
    :tls     => true, 
    :enable_starttls_auto => true  
} 

मेरे लिए काम किया है। आपकी सेटिंग्स ठीक हो सकती हैं कुछ स्थानीय नेटवर्क इन प्रकार के पैकेट को अवरुद्ध करते हैं। मुझे अपने 3 जी नेटवर्क के माध्यम से इसका परीक्षण करना पड़ा।

+1

delivery_method को छोड़ दिया। : एस – lambinator

+0

क्या किसी ने स्प्री के साथ इन सेटिंग्स को आजमाया है? –

+1

मेरा दिन बचाया! :) – vellotis

0

मैं अगर जोहो उनकी सुरक्षा सेटिंग बदल गई यकीन नहीं है, लेकिन @Tyrel Richey के स्वीकार किए जाते हैं जवाब मेरे लिए काम नहीं किया। हालांकि, निम्नलिखित है:

/config/initializers/action_mailer.rb ..

 
# ActionMailer email configuration 
ActionMailer::Base.delivery_method = :smtp 
ActionMailer::Base.smtp_settings = { 
    :address    => ENV['SMTP_ADDRESS'], 
    :port     => ENV['SMTP_PORT'], 
    :domain    => ENV['SMTP_DOMAIN'], 
    :user_name   => ENV['SMTP_USERNAME'], 
    :password    => ENV['SMTP_PASSWORD'], 
    :authentication  => :login, 
    :enable_starttls_auto => true 
} 

कहाँ ..
:address = smtp.zoho.com
:port = 587
:domain विकास में localhost, और उत्पादन में रहते यूआरएल है (उदाहरण के लिए example.com)

+0

अपने बंदरगाह 465 सेट ssl और सच करने के लिए टीएलएस होना चाहिए –

+0

यह @DankeXie काम किया धन्यवाद :)। –

3
FYI करें

:

मान लें कि आपका डोमेन abc.com में है।
मान लीजिए कि आप एक अलग डोमेन, उदा अपने मेलर पर 'से डिफ़ॉल्ट' करते हैं

default from: "\"Elephant\" <[email protected]>" 

यह काम नहीं करेगा जब तक आप अपने Zoho अकाउंट एक ही डोमेन का उपयोग कर 'से डिफ़ॉल्ट' अपने बदल जाते हैं।
तो,

default from: "\"Elephant\" <[email protected]com>" 

काम करेंगे।

0

मैं मेल रेल 4.2.3 इसलिए की तरह साथ भेजने है ...

# config/environments/development.rb 
Rails.application.configure do 
#... 
    config.action_mailer.default_url_options = { host: 'domain' } 
    config.action_mailer.smtp_settings = { address: 'smtp.zoho.com', port: 465, user_name: '[email protected]', password: 'mypassword', authentication: :login, ssl: true } 
end 

आप निश्चित रूप से इस उत्पादन के साथ-साथ इस जोड़कर को config/environments/production.rb

मैं भी ई-मेल पता सेट का उपयोग कर सकते config/initializers/devise.rb में तो मैं पासवर्ड रीसेट निर्देश भेज सकता हूं।

config.mailer_sender = '[email protected]' 


संदर्भ

0

ये सेटिंग्स उत्पादन में मेरे लिए काम किया।

Rails.application.routes.default_url_options[:host] = 'eyehawk.io' 
    config.action_mailer.default_url_options = { :host => 'eyehawk.io' } 
    config.action_mailer.perform_caching = false 

    config.action_mailer.delivery_method = :smtp 
    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.zoho.com", 
     :port     => 587, 
     :domain    => "zoho.com", 
     :user_name   => "[email protected]", 
     :password    => ENV['SMTP_PASSWORD'], 
     :authentication  => :plain, 
     :enable_starttls_auto => true 
    }