ruby on rails - problem with ActionMailer configuration in setup_email.rb -


I spent several days to get this job => I want to send an email from my application using localhost , without using Gmail or other mail server, so I tried to:

In the / Config / initializers / setup_email.rb ActionMailer :: Base.delivery_method =: smtp ActionMailer :: base.smtp_settings = {: address = & gt; "Localhost" ,: Port => 25}

but I refused "connection" - Connect (2) "error message like the following:

  connection Rejected - Connect (2) /home/user1/.rvm/rubies/ruby-1.8.7-p330/lib/ruby/1.8/net/smtp.rb ** 51: In 'Start' / home / user1 / .rvm / rubies / Rabbi-1.87-P330 / Bb / Ruby / 1.8 / Net / SMTP RB: 551: `Open '/ Home / User 1 / RRM / Robbie / RBI-1.8.7- PDF / LIB / RBI / 1.8 / Net / smtp.rb: 551:` do_start' /home/user1/.rvm/ Rubies / ruby-1.8.7-p330 / lib / ruby ​​/ 1.8 / timeout.rb: 67: in 'timeout' / home / user1 /.rvm/rubies/ruby-1.8.7-p330/lib/ruby/ 1.8 / timeout.rb: 101: in `timeout '/home/user1/.rvm/rubies/ruby-1.8.7-p330/lib/ ruby ​​/ 1.8 / net / smtp.rb: 551:` `start_' Home/user1/.rvm/gems/ruby-1.8.7-p330@myapp/gems/mail-2.2.15/lib/mail/network/delivery_methods/smtp.rb: 127: 'Deliver! '/home/user1/.rvm/gems/ruby-1.8.7-p330@myapp/gems/mail-2.2.15/lib/mail/message.rb:1967:in `do_delivery' /home/user1/.rvm / Gems/ruby-1.8.7-p330@myapp/gems/mail-2.2.15/lib/mail/message.rb: 228: `Deliver '/home/user1/.rvm/gems/ruby-1.8.7- In P330@global/gems/actionmailer-3.0.3/lib/action_mailer/base.rb: 401: `deliver_mail '/home/user1/.rvm/gems/ruby-1.8.7-p330@global/gems/activesupport - 3.0.3 / lib / active_support / messages.rb: 52: `device '/home/user1/.rvm/gems/ruby-1.8.7-p330@global/gems/activesupport-3.0.3/lib/active_support/ Messages / instrument.rb: 21: In `device '  

...

How to configure localhost for ActionMailer?

I searched the Internet, it seems that I provide username and password in the Necessary configuration , And Authentication options of some value, I can configure actionable without authentication , username and password

Add it to your environment.rb:

  ActionMailer :: Base.delivery_method =: sendmail Action Mailer :: Base.forums_delizs = true action mailer :: base.rise_delivery_arires = true action mailer :: base.default_charset = "utf-8"    < / Html>

Comments