small medium large xlarge

Generic-user-small
31 Oct 2016, 12:10
Julius (4 posts)

Hi, I have done everything like on book and my outgoing emails server configuration looks like this in enviroment.rb:

Depot::Application.configure do

  config.action_mailer.delivery_method = :sendmail

  config.action_mailer.smtp_settings = {
    adress:         "smtp.gmail.com",
    port:           587,
    domain:         "gmail.com",
    authentication: "plain",
    user_name:      'my-gmail-acc',
    password:       'my-gmail-passw',
    enable_starttls_auto: true
  }
end`

As you can see, I am not using :smtp protocol, since then can not receive emails. But with :sendemail it works. I wonder why…? I am using Mac Sierra. Firewall and antivirus was turned off.

Generic-user-small
01 Nov 2016, 00:17
J Shapiro (2 posts)

It looks like you’ve misspelled address

Generic-user-small
01 Nov 2016, 05:24
Julius (4 posts)

Oh my gosh. Its true. Thanks, man!

Now it works. Now I get it - :sendmail creates its own server and sends emails via the same :smtp protocol. But what is strange, that all letters, sent by :sendmail, went to junk mail and now, first time I received letter to normal box (via :smtp)…

Generic-user-small
15 Nov 2016, 16:25
Ad Rienks (1 post)

Excuse me,

I tried all sorts of methods, but still do not get mail in my e-mail program. The Chapter 13 is unclear to me, and in the source code I see no set-up example. I want to check in development mode.

This line: [ActiveJob] [ActionMailer::DeliveryJob] [2ad0b403-fda3-4652-9fa2-dcba8635bb14] Performed ActionMailer::DeliveryJob from Async(mailers) in 30234.22ms

It looks like there should be sent an e-mail, or is my interpretation false? What is ActiveJob doing? I am sorry, but I do not understand the text and examples in the book!

I should add that Cloud9 development IDE is the environment I use for coding.

kwibus:~/workspace/depot (master) $ rails s -b $IP -p $PORT => Booting Puma => Rails 5.0.0.1 application starting in development on http://0.0.0.0:8080 => Run rails server -h for more startup options Puma starting in single mode… * Version 3.6.0 (ruby 2.3.0-p0), codename: Sleepy Sunday Serenity * Min threads: 5, max threads: 5 * Environment: development * Listening on tcp://0.0.0.0:8080 Use Ctrl-C to stop Started GET “/” for 87.154.159.213 at 2016-11-15 16:10:44 +0000 ActiveRecord::SchemaMigration Load (0.3ms) SELECT “schema_migrations”.* FROM “schema_migrations” Processing by StoreController#index as HTML Cart Load (0.3ms) SELECT “carts”.* FROM “carts” WHERE “carts”.”id” = ? LIMIT ? [[“id”, 31], [“LIMIT”, 1]] Rendering store/index.html.erb within layouts/application Product Load (0.4ms) SELECT “products”.* FROM “products” ORDER BY “products”.”title” ASC Rendered store/index.html.erb within layouts/application (453.4ms) LineItem Exists (0.2ms) SELECT 1 AS one FROM “line_items” WHERE “line_items”.”cart_id” = ? LIMIT ? [[“cart_id”, 31], [“LIMIT”, 1]] LineItem Load (0.3ms) SELECT “line_items”.* FROM “line_items” WHERE “line_items”.”cart_id” = ? [[“cart_id”, 31]] Rendered collection of templates [0 times] (0.0ms) Rendered carts/_cart.html.erb (6.6ms) Completed 200 OK in 668ms (Views: 615.5ms | ActiveRecord: 3.7ms)

Started GET “/cable” for 87.154.159.213 at 2016-11-15 16:10:46 +0000 Started GET “/cable/” [WebSocket] for 87.154.159.213 at 2016-11-15 16:10:46 +0000 Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket) ProductsChannel is transmitting the subscription confirmation ProductsChannel is streaming from products Started POST “/line_items?product_id=1” for 87.154.159.213 at 2016-11-15 16:10:51 +0000 Processing by LineItemsController#create as JS Parameters: {“authenticity_token”=>”oq7WhjtJCwKK0maxl9z4S78Ffcl4CPJHjxLEYbTsle8IqBnlXiNfYuJs2OH2mMDNvazdCr0JQsnExjYwaG+s0Q==”, “product_id”=>”1”} Cart Load (0.2ms) SELECT “carts”.* FROM “carts” WHERE “carts”.”id” = ? LIMIT ? [[“id”, 31], [“LIMIT”, 1]] Product Load (0.5ms) SELECT “products”.* FROM “products” WHERE “products”.”id” = ? LIMIT ? [[“id”, 1], [“LIMIT”, 1]] LineItem Load (0.4ms) SELECT “line_items”.* FROM “line_items” WHERE “line_items”.”cart_id” = ? AND “line_items”.”product_id” = ? LIMIT ? [[“cart_id”, 31], [“product_id”, 1], [“LIMIT”, 1]] (0.1ms) begin transaction SQL (1.8ms) INSERT INTO “line_items” (“product_id”, “cart_id”, “created_at”, “updated_at”) VALUES (?, ?, ?, ?) [[“product_id”, 1], [“cart_id”, 31], [“created_at”, 2016-11-15 16:10:51 UTC], [“updated_at”, 2016-11-15 16:10:51 UTC]] (108.1ms) commit transaction Rendering line_items/create.js.erb LineItem Load (0.2ms) SELECT “line_items”.* FROM “line_items” WHERE “line_items”.”cart_id” = ? [[“cart_id”, 31]] Product Load (0.1ms) SELECT “products”.* FROM “products” WHERE “products”.”id” = ? LIMIT ? [[“id”, 1], [“LIMIT”, 1]] Rendered collection of line_items/_line_item.html.erb [1 times] (5.0ms) Rendered carts/_cart.html.erb (11.3ms) Rendered line_items/create.js.erb (14.4ms) Completed 200 OK in 161ms (Views: 18.4ms | ActiveRecord: 111.8ms)

Started GET “/orders/new” for 87.154.159.213 at 2016-11-15 16:10:56 +0000 Processing by OrdersController#new as HTML Cart Load (0.2ms) SELECT “carts”.* FROM “carts” WHERE “carts”.”id” = ? LIMIT ? [[“id”, 31], [“LIMIT”, 1]] LineItem Exists (0.2ms) SELECT 1 AS one FROM “line_items” WHERE “line_items”.”cart_id” = ? LIMIT ? [[“cart_id”, 31], [“LIMIT”, 1]] Rendering orders/new.html.erb within layouts/application Rendered orders/_form.html.erb (18.5ms) Rendered orders/new.html.erb within layouts/application (20.0ms) LineItem Exists (0.2ms) SELECT 1 AS one FROM “line_items” WHERE “line_items”.”cart_id” = ? LIMIT ? [[“cart_id”, 31], [“LIMIT”, 1]] LineItem Load (0.2ms) SELECT “line_items”.* FROM “line_items” WHERE “line_items”.”cart_id” = ? [[“cart_id”, 31]] Product Load (0.2ms) SELECT “products”.* FROM “products” WHERE “products”.”id” = ? LIMIT ? [[“id”, 1], [“LIMIT”, 1]] Rendered collection of line_items/_line_item.html.erb [1 times] (2.7ms) Rendered carts/_cart.html.erb (6.6ms) Completed 200 OK in 149ms (Views: 70.8ms | ActiveRecord: 2.1ms)

Finished “/cable/” [WebSocket] for 87.154.159.213 at 2016-11-15 16:10:56 +0000 ProductsChannel stopped streaming from products Started GET “/cable” for 87.154.159.213 at 2016-11-15 16:10:56 +0000 Started GET “/cable/” [WebSocket] for 87.154.159.213 at 2016-11-15 16:10:56 +0000 Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket) ProductsChannel is transmitting the subscription confirmation ProductsChannel is streaming from products Started POST “/orders” for 87.154.159.213 at 2016-11-15 16:11:38 +0000 Processing by OrdersController#create as HTML Parameters: {“utf8”=>”✓”, “authenticity_token”=>”Eb74cVz5lLafoR5BTid90D5/dwgOie2jxLRruuZAFm67uDcSOZPA1vcfoBEvY0VWPNbXy8uIXS2PYJnrOsMvUA==”, “order”=>{“name”=>”Ad Rienks”, “address”=>”Straße 123”, “email”=>”kwibus@cloudmail.de”, “pay_type”=>”Credit card”}, “commit”=>”Place Order”} Cart Load (0.2ms) SELECT “carts”.* FROM “carts” WHERE “carts”.”id” = ? LIMIT ? [[“id”, 31], [“LIMIT”, 1]] LineItem Load (0.2ms) SELECT “line_items”.* FROM “line_items” WHERE “line_items”.”cart_id” = ? [[“cart_id”, 31]] (0.1ms) begin transaction SQL (0.8ms) INSERT INTO “orders” (“name”, “address”, “email”, “pay_type”, “created_at”, “updated_at”) VALUES (?, ?, ?, ?, ?, ?) [[“name”, “Ad Rienks”], [“address”, “Straße 123”], [“email”, “kwibus@cloudmail.de”], [“pay_type”, 1], [“created_at”, 2016-11-15 16:11:38 UTC], [“updated_at”, 2016-11-15 16:11:38 UTC]] SQL (0.2ms) UPDATE “line_items” SET “cart_id” = ?, “order_id” = ?, “updated_at” = ? WHERE “line_items”.”id” = ? [[“cart_id”, nil], [“order_id”, 15], [“updated_at”, 2016-11-15 16:11:38 UTC], [“id”, 47]] (11.2ms) commit transaction Cart Load (0.2ms) SELECT “carts”.* FROM “carts” WHERE “carts”.”id” = ? LIMIT ? [[“id”, 31], [“LIMIT”, 1]] (0.0ms) begin transaction LineItem Load (0.2ms) SELECT “line_items”.* FROM “line_items” WHERE “line_items”.”cart_id” = ? [[“cart_id”, 31]] SQL (0.2ms) DELETE FROM “carts” WHERE “carts”.”id” = ? [[“id”, 31]] (7.9ms) commit transaction [ActiveJob] Enqueued ActionMailer::DeliveryJob (Job ID: 2ad0b403-fda3-4652-9fa2-dcba8635bb14) to Async(mailers) with arguments: “OrderMailer”, “received”, “deliver_now”, #<GlobalID:0x007f78b414a580 @uri=#<URI::GID gid://depot/Order/15» Redirected to http://awdwr5-kwibus.c9users.io/ Order Load (0.4ms) SELECT “orders”.* FROM “orders” WHERE “orders”.”id” = ? LIMIT ? [[“id”, 15], [“LIMIT”, 1]] Completed 302 Found in 544ms (ActiveRecord: 21.3ms)

[ActiveJob] [ActionMailer::DeliveryJob] [2ad0b403-fda3-4652-9fa2-dcba8635bb14] Performing ActionMailer::DeliveryJob from Async(mailers) with arguments: “OrderMailer”, “received”, “deliver_now”, #<GlobalID:0x007f78b40e1f30 @uri=#<URI::GID gid://depot/Order/15» [ActiveJob] [ActionMailer::DeliveryJob] [2ad0b403-fda3-4652-9fa2-dcba8635bb14] Rendering order_mailer/received.html.erb within layouts/mailer [ActiveJob] [ActionMailer::DeliveryJob] [2ad0b403-fda3-4652-9fa2-dcba8635bb14] Rendered order_mailer/received.html.erb within layouts/mailer (0.4ms) [ActiveJob] [ActionMailer::DeliveryJob] [2ad0b403-fda3-4652-9fa2-dcba8635bb14] Rendering order_mailer/received.text.erb within layouts/mailer [ActiveJob] [ActionMailer::DeliveryJob] [2ad0b403-fda3-4652-9fa2-dcba8635bb14] LineItem Load (0.2ms) SELECT “line_items”.* FROM “line_items” WHERE “line_items”.”order_id” = ? [[“order_id”, 15]] [ActiveJob] [ActionMailer::DeliveryJob] [2ad0b403-fda3-4652-9fa2-dcba8635bb14] Product Load (0.1ms) SELECT “products”.* FROM “products” WHERE “products”.”id” = ? LIMIT ? [[“id”, 1], [“LIMIT”, 1]] [ActiveJob] [ActionMailer::DeliveryJob] [2ad0b403-fda3-4652-9fa2-dcba8635bb14] Rendered collection of line_items/_line_item.text.erb [1 times] (1.4ms) [ActiveJob] [ActionMailer::DeliveryJob] [2ad0b403-fda3-4652-9fa2-dcba8635bb14] Rendered order_mailer/received.text.erb within layouts/mailer (4.5ms) [ActiveJob] [ActionMailer::DeliveryJob] [2ad0b403-fda3-4652-9fa2-dcba8635bb14] OrderMailer#received: processed outbound mail in 163.0ms Started GET “/” for 87.154.159.213 at 2016-11-15 16:11:39 +0000 Processing by StoreController#index as HTML Cart Load (0.1ms) SELECT “carts”.* FROM “carts” WHERE “carts”.”id” = ? LIMIT ? [[“id”, nil], [“LIMIT”, 1]] (0.1ms) begin transaction SQL (0.3ms) INSERT INTO “carts” (“created_at”, “updated_at”) VALUES (?, ?) [[“created_at”, 2016-11-15 16:11:39 UTC], [“updated_at”, 2016-11-15 16:11:39 UTC]] (11.1ms) commit transaction Rendering store/index.html.erb within layouts/application Product Load (0.2ms) SELECT “products”.* FROM “products” ORDER BY “products”.”title” ASC Rendered store/index.html.erb within layouts/application (8.7ms) LineItem Exists (88.7ms) SELECT 1 AS one FROM “line_items” WHERE “line_items”.”cart_id” = ? LIMIT ? [[“cart_id”, 32], [“LIMIT”, 1]] LineItem Load (0.2ms) SELECT “line_items”.* FROM “line_items” WHERE “line_items”.”cart_id” = ? [[“cart_id”, 32]] Rendered collection of templates [0 times] (0.0ms) Rendered carts/_cart.html.erb (2.5ms) Completed 200 OK in 149ms (Views: 43.0ms | ActiveRecord: 100.6ms)

Finished “/cable/” [WebSocket] for 87.154.159.213 at 2016-11-15 16:11:39 +0000 ProductsChannel stopped streaming from products Started GET “/cable” for 87.154.159.213 at 2016-11-15 16:11:39 +0000 Started GET “/cable/” [WebSocket] for 87.154.159.213 at 2016-11-15 16:11:39 +0000 Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket) ProductsChannel is transmitting the subscription confirmation ProductsChannel is streaming from products [ActiveJob] [ActionMailer::DeliveryJob] [2ad0b403-fda3-4652-9fa2-dcba8635bb14] Sent mail to kwibus@cloudmail.de (30021.0ms) [ActiveJob] [ActionMailer::DeliveryJob] [2ad0b403-fda3-4652-9fa2-dcba8635bb14] Date: Tue, 15 Nov 2016 16:11:38 +0000 From: Sam Ruby depot@example.com To: kwibus@cloudmail.de Message-ID: <582b33babc885_a5d3fbc5a0a51583749f@kwibus-awdwr5-3963690.mail> Subject: Pragmatic Store Order Confirmation Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=”–==_mimepart_582b33bab9347_a5d3fbc5a0a5158373a7”; charset=UTF-8 Content-Transfer-Encoding: 7bit

—-==_mimepart_582b33bab9347_a5d3fbc5a0a5158373a7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit

Dear Ad Rienks

Thank you for your recent order from the Pragmatic Store

You ordered the following items:

1 x Rails, Angular, Postgres, and Bootstrap We’ll send you a separate e-mail when your order ships.

—-==_mimepart_582b33bab9347_a5d3fbc5a0a5158373a7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

<!DOCTYPE html>

/* Email styles need to be inline */

Order#received

, find me in app/views/order_mailer/received.html.erb

—-==_mimepart_582b33bab9347_a5d3fbc5a0a5158373a7–

[ActiveJob] [ActionMailer::DeliveryJob] [2ad0b403-fda3-4652-9fa2-dcba8635bb14] Performed ActionMailer::DeliveryJob from Async(mailers) in 30234.22ms

You must be logged in to comment