#Rails でモデルを作らずに1行ですぐにメール送信する。 ( ActionMailer::Base.mail )
モデルなどを作らず、すぐ送信。
ActionMailer::Base.mail(from: '[email protected]', to: '[email protected]', subject: "Welcome to My Awesome Site", body: 'I am the email body.').deliver
ActionMailer::Base#mail: processed outbound mail in 881.3ms
Sent mail to to@domain.com (190.0ms)
Date: Sun, 13 Oct 2019 09:22:10 +0000
From: from@domain.com
To: to@domain.com
Message-ID: <5da2ecc288c87_342b142f80e5f8474e8@25c1308432ca.mail>
Subject: Welcome to My Awesome Site
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
I am the email body.
=> #<Mail::Message:47365763437540, Multipart: false, Headers: <Date: Sun, 13 Oct 2019 09:22:10 +0000>, <From: [email protected]>, <To: [email protected]>, <Message-ID: <[email protected]>>, <Subject: Welcome to My Awesome Site>, <Mime-Version: 1.0>, <Content-Type: text/plain>, <Content-Transfer-Encoding: 7bit>>
actionmailer - Rails one liner email sending? - Stack Overflow
Original by Github issue
Author And Source
この問題について(#Rails でモデルを作らずに1行ですぐにメール送信する。 ( ActionMailer::Base.mail )), 我々は、より多くの情報をここで見つけました https://qiita.com/YumaInaura/items/8eb7c67836cb79b9acb6著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .