GithubHelp home page GithubHelp logo

html_mail's Introduction

html_mail

htmlメール制作用

概要

SASSをコンパイルしてCSSにした後、CSSをインラインに変換します。
また、ブラウザを自動で更新します。

使い方

$ git clone https://github.com/yuki-tomioka/html_mail.git
$ cd html_mail
$ npm ci
$ npx gulp

メール送信のための設定方法

  • Gmailを使って送信する場合

下記のような.envを作成する。
.env-sampleを.envにリネームして編集してください。

# 送信先(複数はカンマ区切り、スペースを入れない)
mailTo=[email protected],[email protected]

# 送信元
smtpUser=[email protected]
smtpPass=example_03_pass
smtpHost=smtp.gmail.com
smtpPort=465

ログインエラー対応
Gmailを確認すると「重大なセキュリティ通知」としてログインをブロックしましたというメールが届いている場合、安全性の低いアプリのアクセス から安全性の低いアプリの許可を有効にして改善しないか試す。
検証後は設定を元に戻すことをおすすめする。

メールの送信

デフォルトの設定で送信

index.htmlの内容がhtml mail testというタイトルで送信されます。

$ npx gulp mail

ファイルを指定して送信する

--fileオプションに送信したいファイルを拡張子を除いて指定します。

// test.htmlを指定する場合
$npx gulp mail --file test

メールタイトルを指定して送信する

--subjectオプションにタイトル指定します。

// testというタイトルで送りたい場合
$npx gulp mail --subject test

参照

作成環境

  • gulp
    • CLI version: 2.2.0
    • Local version: 4.0.2
  • nodenv
    • local 10.15.3

html_mail's People

Contributors

yuki-tomioka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.