Skip to main content

不知道什么时候跑完程序?发一封邮件吧

Project description

e2me

不知道什么时候跑完程序? 发一封邮件吧

pip install e2me

快速开始

需要在运行程序的服务器端编写一个配置文件, 可以通过 e2me init 自动生成 e2me.toml, 如下所示

[email]
email = "your_email@example.com"
passwd = "your_password"

[content]
subject = "程序运行结束"
body = "[<DATE> | <TIME>] [<KERNEL>] <USER>:<HOSTNAME> "

# [file]
# file_path = ["result.log"]

其中 email 改为您的邮箱地址, 注意这里的密码并不是邮箱的登录密码, 注意这里的密码并不是邮箱的登录密码, 注意这里的密码并不是邮箱的登录密码, 而是需要开启邮箱的 SMTP/POP3 服务后分配给你的密码

本项目目前支持 163/qq/gmail, 请请参考下述链接开启邮箱的 SMTP/POP3 服务并配置好自己的邮箱和密码

扫描二维码发送短信失败可以手动编辑短信

发送邮件

e2me run

subject 为邮件标题, body 为邮件正文内容, 默认提供了 5 个基本宏用于系统信息的记录

如果您同时希望将一些结果文件/日志发送, 可以启用 [file] 并填写文件位置, 它们将会被一起发送到邮箱

[file]
file_path = ["result.log"]

对于 python 程序您可以直接使用该库发送邮件

import e2me

def main():
    # do something

    # finish
    e2me.run()

或者您可以编写一个执行脚本, 最后执行

#!/bin/bash
python main.py
lua 1.py
./myprogram

e2me run

接收邮件

e2me get

邮箱基本信息

# 协议  服务器         SSL    非 SSL
# SMTP smtp.163.com   465    25
# IMAP imap.163.com   993    143
# POP3 pop.163.com    995    110
# -------------------------------
# SMTP smtp.qq.com    465/587
# IMAP imap.qq.com    993
# POP3 pop.qq.com     995
# -------------------------------
# SMTP smtp.gmail.com 465(SSL)/587(TLS/STARTTLS)
# IMAP imap.gmail.com 993
# POP3 pop.gmail.com  995
# -------------------------------
# 163/qq: password 为授权码
# gmail: password 为邮箱密码

参考

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

e2me-0.0.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

e2me-0.0.2-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file e2me-0.0.2.tar.gz.

File metadata

  • Download URL: e2me-0.0.2.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.9 Windows/10

File hashes

Hashes for e2me-0.0.2.tar.gz
Algorithm Hash digest
SHA256 02ca80aae66a2a1ecbcbbd791f4eb2cbf7663129fae76d8b1e2fb73407cf1d11
MD5 76af993c9280c5fd0ee1f3d9420599fa
BLAKE2b-256 b54e9643f205e7553a78acf61ad709afe1f15d9d0e293bfb2aef971f930a1d3e

See more details on using hashes here.

File details

Details for the file e2me-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: e2me-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.9 Windows/10

File hashes

Hashes for e2me-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 196c4f4a91ae98c4c66096bb77e6f64ad92c4b07e8a1078457632c90601dd219
MD5 0b69a8350fd5e6139646e1f227d478f7
BLAKE2b-256 76a7662ae0dea5da834a470af13d04873d8487cb17ada676cd002a0428986c42

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page