diff --git a/nodemailer/README.md b/nodemailer/README.md deleted file mode 100644 index 81448bd..0000000 --- a/nodemailer/README.md +++ /dev/null @@ -1,6 +0,0 @@ -``` -docker compose up -d -# http://localhost:8025 にアクセスして確認 -pnpm i -node index.mjs -``` diff --git a/nodemailer/compose.yml b/nodemailer/compose.yml deleted file mode 100644 index 3761cfa..0000000 --- a/nodemailer/compose.yml +++ /dev/null @@ -1,19 +0,0 @@ -services: - # maildev: - # image: maildev/maildev - # ports: - # - "1080:1080" # Web UI - # - "1025:1025" - # environment: - # MAILDEV_INCOMING_USER: postmaster - # MAILDEV_INCOMING_PASS: password - mailpit: - image: axllent/mailpit - ports: - - "8025:8025" # Web UI - - "1025:1025" - environment: - MP_SMTP_AUTH_FILE: /etc/mailpit/auth - MP_SMTP_AUTH_ALLOW_INSECURE: "true" - volumes: - - ./etc/mailpit:/etc/mailpit:ro diff --git a/nodemailer/etc/mailpit/auth b/nodemailer/etc/mailpit/auth deleted file mode 100644 index 7eaaa96..0000000 --- a/nodemailer/etc/mailpit/auth +++ /dev/null @@ -1 +0,0 @@ -postmaster:password diff --git a/nodemailer/index.mjs b/nodemailer/index.mjs deleted file mode 100644 index 8ff11e1..0000000 --- a/nodemailer/index.mjs +++ /dev/null @@ -1,20 +0,0 @@ -import nodemailer from "nodemailer"; - -const transporter = nodemailer.createTransport({ - host: "localhost", - port: 1025, - secure: false, - auth: { - user: "postmaster", - pass: "password", - }, -}); - -const info = await transporter.sendMail({ - from: "foo <foo@example.com>", - to: "bar <bar@example.com>", - subject: "Hello world!", - html: "<marquee>Hello world.</marquee>", -}); - -console.log(info.messageId); diff --git a/nodemailer/package.json b/nodemailer/package.json deleted file mode 100644 index f868a31..0000000 --- a/nodemailer/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "nodemailer", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "Kohei Watanabe <kou029w@gmail.com>", - "license": "MIT", - "devDependencies": { - "nodemailer": "^6.9.4" - } -} diff --git a/nodemailer/pnpm-lock.yaml b/nodemailer/pnpm-lock.yaml deleted file mode 100644 index e1605b0..0000000 --- a/nodemailer/pnpm-lock.yaml +++ /dev/null @@ -1,13 +0,0 @@ -lockfileVersion: '6.0' - -devDependencies: - nodemailer: - specifier: ^6.9.4 - version: 6.9.4 - -packages: - - /nodemailer@6.9.4: - resolution: {integrity: sha512-CXjQvrQZV4+6X5wP6ZIgdehJamI63MFoYFGGPtHudWym9qaEHDNdPzaj5bfMCvxG1vhAileSWW90q7nL0N36mA==} - engines: {node: '>=6.0.0'} - dev: true diff --git a/nodemailer/sendgrid.mjs b/nodemailer/sendgrid.mjs deleted file mode 100644 index 5ff1305..0000000 --- a/nodemailer/sendgrid.mjs +++ /dev/null @@ -1,21 +0,0 @@ -import nodemailer from "nodemailer"; - -// see https://support.sendgrid.kke.co.jp/hc/ja/articles/204187885-SMTP%E3%81%AE%E6%8E%A5%E7%B6%9A%E6%83%85%E5%A0%B1%E3%82%92%E6%95%99%E3%81%88%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84- -const transporter = nodemailer.createTransport({ - host: "smtp.sendgrid.net", - port: 465, - secure: true, - auth: { - user: "apikey", - pass: "SG.****", // https://app.sendgrid.com/settings/api_keys > Create API Key > Mail Send > Custom Access > Mail Send - }, -}); - -const info = await transporter.sendMail({ - from: "foo@example.org", - to: "bar@example.org", - subject: "Hello world!", - html: "<marquee>Hello world.</marquee>", -}); - -console.log(info.messageId);