@echo off
setlocal enabledelayedexpansion
rem メールの設定
set to=to@example.com
set cc=cc1@example.com,cc2@example.com
set bcc=bcc@example.com
rem 日付の取得とURLエンコード
for /f "tokens=2 delims==" %%i in ('wmic OS Get localdatetime /value ^| find "="') do set datetime=%%i
set year=!datetime:~0,4!
set month=!datetime:~4,2!
set day=!datetime:~6,2!
set subject=自動生成メール(!year!-!month!-!day!)
set body=これは自動生成されたメールの本文です。%0D%0A次の行のテキストです。%0D%0Aさらに次の行のテキストです。
rem メールを開く
start "" "mailto:%to%?cc=%cc%&bcc=%bcc%&subject=!subject!&body=!body!"
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme