2010-11-20 15 views
21

मैं डेविस का उपयोग कर रहा हूं: पुष्टि करने योग्य और: उपयोगकर्ता की पुष्टि करने के लिए पुनर्प्राप्ति योग्य मॉड्यूल और उसे भूलने पर उसे अपना पासवर्ड पुनर्प्राप्त करने दें। सब ठीक हो रहा है, मेल उत्पन्न हो गया है और मैं इसे सर्वर लॉग में देख सकता हूं, लेकिन फिर मुझे त्रुटियों का सामना करना पड़ रहा है और मेल मेलबॉक्स पर मेल नहीं दिया गया है। मेरी environment.rb फ़ाइल के लिए SMTP सेटिंग है:डिवाइज और जीमेल एसएमटीपी सर्वर के साथ मेल भेजना

require 'tlsmail' 
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE) 
ActionMailer::Base.raise_delivery_errors = true 
ActionMailer::Base.perform_deliveries = true 
ActionMailer::Base.delivery_method = :smtp 

ActionMailer::Base.smtp_settings = { 
    :enable_starttls_auto => true, #this is the important shit! 
    :address => 'smtp.gmail.com', #'localhost', 
    :port => 587, 
    :tls => true, 
    :domain => 'mail.google.com', # mail.customdomain.com if you use google apps 
    :authentication => :login, 
    :user_name => '[email protected]', 
    :password => '_secret_password' 
} 

हैं: पता है 'smtp.gmail.com' है, तो मैं निम्नलिखित त्रुटि मिलती है:

SocketError (getaddrinfo: Name or service not known): 

तो मैं सेट : करने के लिए निम्न त्रुटि 'स्थानीय होस्ट' है, तो मैं मिल पता: पता मतलब है, यह सब सामान के लिए एक नौसिखिया:

Errno::ECONNREFUSED Connection refused - connect(2) 

मैं क्या यह पता नहीं है। चल पर uname -एक, मैं प्राप्त

Linux jatin-ubuntu 2.6.32-24-generiC#38-Ubuntu SMP Mon Jul 5 09:22:14 UTC 2010 i686 GNU/Linux 

मेरी /etc/hosts में फ़ाइल प्रविष्टियों हैं:

127.0.0.1 localhost 
127.0.1.1 jatin-ubuntu 

*#74.125.93.109 smtp.gmail.com 
#The above entry added by me* 

# The following lines are desirable for IPv6 capable hosts 
::1  localhost ip6-localhost ip6-loopback 
fe00::0 ip6-localnet 
ff00::0 ip6-mcastprefix 
ff02::1 ip6-allnodes 
ff02::2 ip6-allrouters 
ff02::3 ip6-allhosts 

जब मैं 'smtp.gmail.com' पता uncomment/etc/hosts फ़ाइल में, निम्न त्रुटि समाप्त हो गई है:

SocketError (getaddrinfo: Name or service not known): 

और अब त्रुटि है:

Errno::ECONNREFUSED Connection refused - connect(2) 

मुझे नहीं पता कि क्या गलत हो रहा है, त्रुटियों के लिए googled और सब कुछ करने की कोशिश की लेकिन कुछ भी बचाव के लिए आया था। मैं भी 'tlsmail' मणि स्थापित किया है और 'मेल' मणि की क्या ज़रूरत है, और मेरे अनुप्रयोग विकास मोड में है। मुझे इस त्रुटि को ठीक करने में सहायता करें ताकि मैं खुशी से अपनी रेल यात्रा जारी रख सकूं और यदि संभव हो तो मुझे इस पर थोड़ा सा मार्गदर्शन करें: सही दिशा में पता समस्या ताकि मैं इसकी मूल बातें समझ सकूं। अग्रिम धन्यवाद

उत्तर

24

आप अभी भी इस के साथ समस्या हो रही है इन सेटिंग्स का उपयोग करके देखें:

require 'tlsmail'  
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE) 

ActionMailer::Base.delivery_method = :smtp 
ActionMailer::Base.perform_deliveries = true 
ActionMailer::Base.raise_delivery_errors = true 
ActionMailer::Base.smtp_settings = { 
    :enable_starttls_auto => true, 
    :address   => 'smtp.gmail.com', 
    :port    => 587, 
    :tls     => true, 
    :domain    => 'gmail.com', #you can also use google.com 
    :authentication  => :plain, 
    :user_name   => '[email protected]', 
    :password   => '_secret_password' 
} 

इसके अतिरिक्त मैं इतना है कि आप अलग अलग mailservers निर्दिष्ट कर सकते हैं अपने config/वातावरण/development.rb environment.rb के बजाय फ़ाइल में इन सेटिंग्स डाल सिफारिश करेंगे प्रत्येक पर्यावरण के लिए।

+0

धन्यवाद आदमी ... यह वास्तव में काम करता था। यदि आपके पास मेरा डोमेन है और उस डोमेन द्वारा उपयोगकर्ता नाम है तो क्या आप सेटिंग्स को भी दंडित कर सकते हैं। –

+0

बस अपना डोमेन और user_name होने के लिए डोमेन को [email protected] बनें ... बाकी सब कुछ वही होना चाहिए। –

+0

इस सेटिंग के साथ, क्या यह [email protected] से किसी भी मेलिंग पते पर ईमेल भेजेगा? – shibly

0

शायद समस्या यहाँ समझाया गया है:

http://mail.google.com/support/bin/answer.py?answer=10336

अन्य संसाधन:

+0

@Rio तेरा: मैं इन सभी चीजों के लिए नौसिखिया हूं, इसलिए समझ में नहीं आया कि आप मुझे क्या मार्गदर्शन कर रहे हैं। क्या आप थोड़ा –

+0

विस्तृत कर सकते हैं: डोमेन शायद आपका डोमेन 'उदाहरण होना चाहिए।कॉम ' – riotera

+0

@Rio तेरा: मेरे पास अभी तक मेरा खुद का डोमेन नहीं है, वेब विकास के लिए एक नौसिखिया। तब मुझे क्या करना चाहिए?? क्या इस के लिए अपना खुद का डोमेन एक शर्त है ?? यदि हां, तो मैं एक asap –

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