A
A
Alexander Petrov2015-12-12 22:56:32
Ruby on Rails
Alexander Petrov, 2015-12-12 22:56:32

How to send mail in Ruby on Rails?

In general, the question is simple.
I created a controller, made a view, set up development.rb and nothing is sent.
all as here did: rusrails.ru/action-mailer-basics
Logs of errors do not issue like.
What could be the problem?
I'll attach the logs just in case:

Started GET "/" for 109.172.53.212 at 2015-12-12 22:43:03 +0300
Cannot render console from 109.172.53.212! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
  [1m[36mActiveRecord::SchemaMigration Load (0.6ms)[0m  [1mSELECT `schema_migrations`.* FROM `schema_migrations`[0m
Processing by FoldersController#index as HTML
  Rendered user_mailer/send_email.html.erb within layouts/mailer (1.6ms)
  Rendered user_mailer/send_email.text.erb within layouts/mailer (0.3ms)

UserMailer#send_email: processed outbound mail in 728.7ms

Sent mail to [email protected] (169.2ms)
Date: Sat, 12 Dec 2015 22:43:04 +0300
From: [email protected]
To: [email protected]
Message-ID: <[email protected]>
Subject: Welcome to My Awesome Site
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="--==_mimepart_566c78c84b770_43b460772e82332";
 charset=UTF-8
Content-Transfer-Encoding: 7bit


----==_mimepart_566c78c84b770_43b460772e82332
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html>
<html>
  <head>
    <meta content=3D'text/html; charset=3DUTF-8' http-equiv=3D'Content-Ty=
pe' />
  </head>
  <body>
    =D0=9F=D1=80=D0=B8=D0=B2=D0=B5=D1=82)
  </body>
</html>

----==_mimepart_566c78c84b770_43b460772e82332
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html>
  <body>
    <!DOCTYPE html>
<html>
  <head>
    <meta content=3D'text/html; charset=3DUTF-8' http-equiv=3D'Content-Ty=
pe' />
  </head>
  <body>
    =D0=9F=D1=80=D0=B8=D0=B2=D0=B5=D1=82)
  </body>
</html>
  </body>
</html>

----==_mimepart_566c78c84b770_43b460772e82332--

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Mirilaczvili, 2015-12-13
@Mirkom63

Look for the answer in the Action Mailer settings in development.rb . Must be specified

config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :smtp

Use MailCatcher to check during development:
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }

S
sim3x, 2015-12-12
@sim3x

stackoverflow.com/questions/29417328/how-to-disabl...
but first you need to understand what's going on

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question