资源简介
python写的可以在树莓派,windows, linux, mac平台上制定时间发送设备所在网络的外网ip到自己邮箱
代码片段和文件信息
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#teller@2019-04-26 17:16:11
import urllib.request
import urllib.error
import re
import os
import datetime
import shutil
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.header import Header
import time
def eSend(sender receiver username password smtpserver subject e_content file_path file_name):
try:
message = MIMEMultipart()
message[‘From‘] = sender
message[‘To‘] = ““.join(receiver)
message[‘Subject‘] = Header(subject ‘utf-8‘)
message.attach(MIMEText(e_content ‘plain‘ ‘utf-8‘))
if ((file_path != None) and (file_name != None)):
att1 = MIMEText(open(file_path+file_name ‘rb‘).read() ‘base64‘ ‘utf-8‘)
att1[‘Content-Type‘] = ‘application/octet-stream‘
att1[‘Content-Disposition‘] = “attachment;filename=“+file_name
message.attach(att1)
smtp = smtplib.SMTP()
smtp.connect(smtpserver)
smtp.login(username password)
smtp.sendmail(sender receiver
- 上一篇:位图转g代码轮廓加工源码
- 下一篇:windows将Python添加到注册表
相关资源
- 基于PyQt5的视频播放器设计
- 以树莓派为基础,连接有毒气体传感
- 树莓派Python编程入门与实战
- 树莓派与Python学习一
- 树莓派Python编程指南
-
树莓派人脸识别python代码及xm
l模型 - 基于树莓派的门禁管理系统
- 人脸识别门禁系统 毕业设计 可移植
- 树莓派Python编程指南.[美]Alex Bradbury
- Python-树莓派上的VR开发用Python实现
- face_jiance.py
- 树莓派LoRa教程.docx
- 树莓派利用红外线传感器进行循迹
- Python-Python爬虫京东自动打码登录指定
- Python-flask树莓派网页端控制开关灯采
- Python3 itchat实现微信定时发送群消息的
- 使用 pubnub 云端平台 控制树莓派GPIO的
- python实现定时登陆新浪微博并发送图
- 树莓派巡线白线.py
- 树莓派动作捕捉抓拍存储图像脚本
- 树莓派声控脚本python
- 树莓派目标跟踪代码python
- 树莓派_python_PCA9685_16路舵机自定义角
- 树莓派避障小车.py
- Python-每天定时发消息
- RPi.GPIO-0.6.3.tar
- 树莓派与PC端在局域网内运用python实现
- 微信定时发送消息源码
- 树莓派http协议onenet平台案例
- python语言实现通过树莓派Pi camera的图
评论
共有 条评论