#Rails는 모형을 만들지 않고 한 줄로 바로 메일을 보냅니다.( ActionMailer::Base.mail )

4145 단어 Rails
모형 제작 없이 바로 발송.
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

좋은 웹페이지 즐겨찾기