0
1

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.

Google Apps Scriptでメール送信API作成【爆速GAS Mail】

Last updated at Posted at 2023-05-01

つくりかた

新しいプロジェクトを作る

作る
https://script.google.com/

function doPost(e) {
  const { recipient, subject, body, ...options } = JSON.parse(e.postData.getDataAsString())
  GmailApp.sendEmail(recipient, subject, body, options)
  Logger.log('REMAINING_DAILY_QUOTA: ' + MailApp.getRemainingDailyQuota())
  return ContentService.createTextOutput()
}

Gmail APIを有効にする

サービス からGmail APIを追加にしてください

image.png

ビクロイ

image.png
image.png
image.png
image.png
image.png
image.png
image.png

実行

上記のURLに置き換えてね

curl -d '{"recipient":"your_name@gmail.com","subject":"タイトル","body":"本文"}' https://script.google.com/macros/s/Deployment_ID/exec
0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?