0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

#Rails でモデルを作らずに1行ですぐにメール送信する。 ( ActionMailer::Base.mail )

Last updated at Posted at 2019-10-13

モデルなどを作らず、すぐ送信。

ActionMailer::Base.mail(from: 'from@domain.com', to: 'to@domain.com', 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: 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>, <Content-Transfer-Encoding: 7bit>>

actionmailer - Rails one liner email sending? - Stack Overflow

image

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?