Skip to content
youngtaejuPublic

About

Gmail SMTP 메일 발송 CLI

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

gsend

Gmail SMTP로 메일을 보내는 CLI. 앱 비밀번호는 OS 자격 증명 저장소(Windows 자격 증명 관리자 등)에 보관.

설치

pipx (Python 3.9+, git 필요)

# pipx 미설치 시
python -m pip install --user pipx
python -m pipx ensurepath   # 이후 터미널 재시작

pipx install git+https://github.com/youngtaeju/gsend          # main 최신
pipx install git+https://github.com/youngtaeju/gsend@v0.1.1   # 특정 버전
pipx upgrade gsend

Windows 단일 실행 파일

Python 없이 실행 가능. Releases의 gsend.exe를 내려받아 PATH에 포함된 폴더에 배치.

설정

  1. Google 계정에 2단계 인증 활성화
  2. https://myaccount.google.com/apppasswords 에서 앱 비밀번호 생성 (16자리)
  3. 발신 주소를 환경변수로 설정
setx GMAIL_USER "you@gmail.com"

setx는 이미 실행 중인 프로세스에 반영되지 않음. 터미널 앱(VS Code 포함)을 완전히 종료 후 재실행.

  1. 앱 비밀번호를 자격 증명 저장소에 저장 (입력 프롬프트에 붙여넣기, 화면에 표시되지 않음, 공백 포함 가능)
gsend --set-password

Windows에서는 제어판 > 자격 증명 관리자 > Windows 자격 증명에 gsend 이름으로 저장됨. 변경은 같은 명령으로 덮어쓰기, 삭제는 자격 증명 관리자에서 제거.

사용법

# 기본
gsend --to a@example.com -s "제목" -b "본문"

# 여러 수신자, 참조, 숨은 참조
gsend --to a@example.com b@example.com --cc c@example.com --bcc d@example.com -s "제목" -b "본문"

# 본문 파일 + 첨부
gsend --to a@example.com -s "보고서" --body-file body.txt -a report.pdf image.png

# HTML 본문
gsend --to a@example.com -s "HTML" --html --body-file mail.html

# 파이프 입력을 본문으로
Get-Content log.txt | gsend --to a@example.com -s "로그"

gsend -h로 전체 옵션 확인.

License

MIT

About

Gmail SMTP 메일 발송 CLI

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages