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.3.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: e2me-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 873f58fe5b00cf2ca7c6bf8c3efcd4330e08d33a1dbe7d534c63f6d3fbc33eea
MD5 24838dc7e1008ff30c72db63a0264cdc
BLAKE2b-256 4d5c42c283a163acc5c9e18bf2306eba72edb6e852bfde11ad53ba9ead7dd9e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: e2me-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 986a749c672eb7ef9ecb81ec67135a8bff1ff6da08c10dc245a7ef307710b67e
MD5 6bd4b22521fe438c7f1ed4863e9fa4c8
BLAKE2b-256 93f0c2d672a05163ed1484e34528b0711042993a51eb758311603084e6f03894

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