Skip to content

solanyn/emailer

Repository files navigation

emailer

This project is a Rust program that sends an email using IMAP. Epson inkjet printers can be prone to clogging if unused, so this project sends email to print to Epson Email Print online service. The service connects back to my printer and prints the attachments and email body message.

Usage

To run the rust binary, set the following environment variables to configure SMTP server and credentials:

EMAILER_FROM_EMAIL="[email protected]" \
EMAILER_TO_EMAIL="[email protected]" \
EMAILER_SMTP_SERVER="smtp.gmail.com" \
EMAILER_SMTP_USERNAME="[email protected]" \
EMAILER_SMTP_PASSWORD="super_secret-p@ssw0rd" \
EMAILER_EMAIL_ATTACHMENT_URL="https://colortest.page/wp-content/uploads/2023/05/printer-color-test-page-pdf.jpg" \
RUST_LOG="info" \
cargo run

To build the container:

docker build -t emailer .

To run and configure the container:

docker run \
    -e EMAILER_FROM_EMAIL="[email protected]" \
    -e EMAILER_TO_EMAIL="[email protected]" \
    -e EMAILER_SMTP_SERVER="smtp.gmail.com" \
    -e EMAILER_SMTP_USERNAME="[email protected]" \
    -e EMAILER_SMTP_PASSWORD="super_secret-p@ssw0rd" \
    -e EMAILER_EMAIL_ATTACHMENT_URL="https://colortest.page/wp-content/uploads/2023/05/printer-color-test-page-pdf.jpg" \
    -e RUST_LOG="info" \
    emailer

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages