Python - 网易邮箱邮件阅读和删除辅助小脚本

使用Python读取网易邮箱大师客户端的所有邮件 阅读详情

简介:在Windows下的网易邮箱大师客户端中,阅读邮件时,可以使用快捷键Delete删除邮件,然后自动跳到下一封,如果再按一次Delete键,再跳到下一封。为了迅速的阅读邮件,同时删除没有必要的邮件,特地写了如下脚本,自用同时放出来共享。

很多人学习python,不知道从何学起。
很多人学习python,掌握了基本语法过后,不知道在哪里寻找案例上手。
很多已经做案例的人,却不知道如何去学习更加高深的知识。
那么针对这三类人,我给大家提供一个好的学习平台,免费领取视频教程,电子书籍,以及课程的源代码!
QQ群:961562169

 

问题:

1. 如上图,我积累太多未读邮件,原因是每天邮件太多,根本看不完,数量马上到上限了;

2. 我想看到每封邮件;

3. 邮件有时内容太过鸡肋,属于知晓型即可,看完即可删除;

4. 大多数看完就要删除,一个个删除太麻烦;

一句话,需要自动删除我看完之后觉得没有用处的邮件。

一个解决方案:

见如下代码

import win32api
import time


def fast_email_reading_and_delete(vk_code: int) -> None:
    """
    Virtual Key Code reference: https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
    """
    print("Running, please switch to the software you are using within 3 seconds!")
    time.sleep(3) # use this 3 seconds to switch to the software you use, for example Netease email client
    count = 0
    while True:
        win32api.keybd_event(int(vk_code), 0, 0, 0)
        
        count += 1
        if count % 30 == 0: # refresh every 30 seconds to get more email from Netease email server
            win32api.keybd_event(int(0x71), 0, 0, 0)   # 0x71 is F2 refresh, int is 113
        time.sleep(1) # mail reading time
        
        # press space key or right arrow would halt the delete process. 0x20 spacekey 0x27 right arrow key
        if win32api.GetAsyncKeyState(int(0x20)) or win32api.GetAsyncKeyState(int(0x27)): 
            while True:
                time.sleep(0.5)
                if win32api.GetAsyncKeyState(int(0x20)) or win32api.GetAsyncKeyState(int(0x27)):
                    break

if __name__ == '__main__':
    fast_email_reading_and_delete(0x2E) # 0x2E is DEL key, equivalent int is 46

将来我如果有机会自行开发邮件客户端,就将自动展现邮件内容(一封接着另一封)、自动删除(或者归档)邮件,作为原始功能提供给用户。

理论上讲,上述脚本适用于任何有DEL快捷键功能的软件,注意不要把自己的东西搞砸了,自动删除时间是1秒。

好了,以上代码调用了Windows的api,所以只能在Windows下运行,Linux下面应该有类似的工具,欢迎留言交流!

python+selenium完整的自动化测试163邮箱实战 之前,通过学习所写得是简单的163自动化登录测试。但是真正实际的项目不可能那么简单的,经过最近的学习和简单的实战项目的操作,小编对前面的例子做了一些调整和修改。     树立了测试框架如下图: 其中增加了测试用例的集成,测试报告输出,自动发送最新的测试报告等功能。 其中test_case目录如下: 其中all_test.py为执行代码块,集成了输出测试报告与自动发送邮件的功能,代码如下 阅读详情

相关推荐

Python使用SMTP发送邮件(163,yeah等网易邮箱已测试可以)

#! /usr/bin/env python # -*- coding: UTF-8 -*- import smtplib from email.mime.text import MIMEText mailto_list=['XXXX@xxx.com'] #收件人(列表) mail_host="smtp.163.com" #使用的邮箱的smtp服务器地址,

lucahan的博客 6万+

Python - 网易邮箱邮件阅读和删除辅助小脚本!

摘要:【原创】转载请注明作者Johnthegreat和本文链接 简介:在Windows下的网易邮箱大师客户端中,阅读邮件时,可以使用快捷键Delete删除邮件,然后自动跳到下一封,如果再按一次Delete键,再跳到下一封。为了迅速的阅读邮件,同时删除没有必要的邮件,特地写了如下脚本,自用同时放出来共享。 问题: 1. 如上图,我积累太多未读邮件,原因是每天邮件太多,根本看不完,数量马上到上限了; 2. 我想看到每封邮件; 3. 邮件有时内容太过鸡肋,属于知晓型即可,看完即可删除; 4. 大多

爬遍所有网站 432

新手也能玩转!用Panosim+MATLAB/Simulink搭建你的第一个智能驾驶仿真场景(保姆级图文)

本文为新手提供了使用Panosim和MATLAB/Simulink搭建智能驾驶仿真场景的详细教程。从环境准备、基础场景创建到仿真模型构建,一步步指导用户完成第一个智能驾驶仿真项目,帮助零基础用户快速上手并体验智能驾驶仿真的乐趣。

weixin_29090089的博客 197

删邮件python脚本

删邮件python脚本 某人说删公司邮箱很抠门,只能存3天,foxmail设置是7天,分分钟爆掉。于是写了个脚本 -- coding: utf-8 -- import telnetlib import time 连接Telnet服务器 tn = telnetlib.Telnet(‘mail.tedu.cn’,110) tn.read_until(b’+OK Hello there.\r\n’) p...

qq_35952353的博客 1276

学习Fidder主要掌握的技术——流量篡改

本文介绍了Fiddler工具的三种常用调试方法:1)本地映射-通过保存修改JSON响应文件实现接口数据模拟;2)Composer接口调试-通过修改请求参数快速测试接口异常处理;3)断点调试-在请求/响应过程中拦截并修改数据。这三种方法分别适用于前端开发、接口测试和健壮性验证等场景,能够有效提高调试效率。操作步骤包括保存响应、修改数据、配置规则等关键环节,并提供了详细的界面操作指引。

2301_79022773的博客 356

ISP工程师实战笔记:5种Demosaic算法优缺点对比(含Hamilton/DFPD代码片段)

本文从ISP工程师实战角度,深入对比了五种经典Demosaic算法的优缺点。文章详细剖析了双线性插值、Hamilton、DFPD、DLMMSE和GBTF等算法的核心思想、实现差异与性能表现,并提供了Hamilton和DFPD算法的关键代码片段。重点探讨了在图像信号处理流水线中,如何根据画质、计算复杂度和功耗等工程约束进行算法选型与权衡。

weixin_42527589的博客 253

利用python实现163邮箱邮件的自动删除

问题:邮箱大量邮件无法批量删除 解决思路:利用python控制鼠标实现邮件自动删除 利用python的pyautogui实现鼠标的控制 import pyautogui as pg screenWidth, screenHeight = pg.size() pg.moveTo(screenWidth / 2, screenHeight / 2) print(pg.size()) #返回窗口大小,比如(1920,1080) # pg.moveTo(100, 100) #移动鼠标 num=1 while num

y_xiuzhu的博客 1434

ESP32接入扣子(Coze) API使用自定义智能体

本示例将使用ESP32开发板通过WiFi接入 **Coze API**,实现一个简单的聊天机器人功能。用户可以通过串口向机器人输入问题,ESP32将通过Coze API与智能体进行通信,并返回对应的回复。本文将详细介绍了如何通过HTTP请求和JSON解析来与API进行交互,并给出完整的代码示例。

宁子希的博客 1万+

Python操作邮箱发送邮件(网易邮箱)

python使用 smtplib、email 操作邮箱发送邮件

qq_52421831的博客 8799

从编解码芯片看Tesla T4的隐藏实力:双NVDEC如何实现70路1080P解码?

本文深入剖析了英伟达Tesla T4显卡的隐藏实力,重点解读其独特的双NVDEC硬件解码器设计如何突破性能瓶颈。通过分析Turing架构、对比HEVC/H.264解码差异,并结合驱动与SDK优化,揭示了实现高达70路1080P视频流并发解码的原理与实战配置,为云游戏、直播转码等高并发场景提供高效解决方案。

weixin_29209801的博客 500

在 Linux 虚拟机中手动安装 VMware Tools

对于 Linux 虚拟机,您可以从命令行手动安装 VMware Tools。对于 Linux 的较高发行版,请使用集成的 open-vm-tools 版本。 前提条件 有关 open-vm-tools 的操作系统兼容性的详细信息,请参见《VMware 兼容性指南》,网址为VMware Compatibility Guide - System Search。 开启虚拟机。 确认客户机操作系统正在运行。 因为 VMware Tools 安装程序是使用 Perl 编写的,请确认已在客户机操作系统中安..

m0_62526815的博客 1761

python模拟登录网易163邮箱并发送SOS邮件

基本环境配置 1. Selenium- 建议使用低版本的Python-Selenium库,因为高版本在Chrome中不支持。 pip3 install selenium==2.48.0 2. chromedriver.exe- 下载地址:http://npm.taobao.org/mirrors/chromedriver/, 版本要匹配。将 .exe 程序放在"..Python\Py...

人生苦短, 还不用Python? 3855

YOLOv11改进缝合注意力 | 深度优化的BiFormer模型-结合BiLevel Routing Attention与深度可分离卷积的创新应用(附代码)

YOLO(You Only Look Once)系列目标检测算法一直以来都是计算机视觉领域的热门选择。随着YOLOv11的发布,它在许多实际应用场景中取得了显著的性能提升。然而,面对日益复杂的目标检测任务,单纯依赖卷积神经网络(CNN)在某些情况下已经显得力不从心,特别是在处理小尺度、密集目标以及遮挡目标时,卷积操作的局部性限制了模型的表达能力。

一键难忘的博客 737

Python selenium 批量删除邮件

当时公司爬虫的运行日志是发到我的163邮箱的,我离职的时候发现邮箱有4万多条,手动动删除一页100条,还需要删400下,百度也没找到批量删除的方法,就写了个小脚本 from selenium import webdriver import time def delete_email(num): browser = webdriver.Chrome() browser.get(...

weixin_42544006的博客 1319

matlab 受约束的 Delaunay 三角剖分【2025最新版】

matlab内置调用函数实现受约束的 Delaunay 三角剖分并将结果保存为STL文件

点云侠的博客 1877

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

Zmail:简化Python邮件处理的利器

Zmail:简化Python邮件处理的利器 在现代编程实践中,邮件处理是一个常见但往往繁琐的任务。幸运的是,开源社区不断推出新的工具来简化这一过程。今天,我们要介绍的是一个名为Zmail的Python库,它旨在让邮件发送和接收变得前所未有的简单。 项目介绍 Zmail是一个专为Python3设计的邮件处理库,它允许用户无需手动配置服务器地址、端口或协议,就能轻松发送和接收邮件。通过使用Python...

gitblog_00281的博客 515

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

网易邮箱登录自动化脚本

元素定位参考这里:元素定位 from selenium import webdriver from time import sleep driver = webdriver.Ie() frist_url="http://mail.163.com/#return" driver.get(frist_url) #切换到iframe(id = "x-URS-iframe") driver.

软件测试技术的博客 4749

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

python自动发送带附件和多位收件人的邮件(163邮箱,亲测可用)

1.新建py脚本,sendmail.py import smtplib from email.header import Header from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText # 创建一个带附件的邮件实例 message=MIMEMultipart() # 邮件的其...

我会有喵的博客(^~^) 1194

Python使用zmail发送邮件最简单实现

首先pip安装依赖 pip3 install zmail 然后看这个示例就够了 import zmail mail_content = { "subject": "异想之旅轻量网盘服务邮件验证码", #邮件主题 "content_html": """ <p>用户你好,这里是异想之旅。</p> """, # 正文内容,使用HTML书写;直接输入纯文本也是可以的 "from": "异想之旅验证码机器人 <coder@yixia

异想之旅的博客 703

Domino下通过vbs脚本删除指定主题邮件

环境介绍: Hostname:Dsgrd-Mail01 IP:192.168.220.11 Roles:Mail server Hostname:Dsgrd-Mail02 IP:192.168.220.12 Roles:Mail server Domino安装路径: D:\IBM\Lotus\Domino\data\mail 数据库路径:D:\IBM\L...

weixin_33701617的博客 258

Python 网易邮箱简单发送邮件

import smtplib #导入PyEmail from email.mime.text import MIMEText msg_from="130xxxxx490@163.com" #发件人邮箱 passwd="xyy0820" #客户端授权密码,不是邮箱登陆密码 msg_to="19xxxxxx59@qq.com" #接收人邮箱 subject="邮件主题" conte...

tjfsuxyy的博客 2659

网易邮箱大师获取下载链接时的验证码的分析解决 python

网易邮箱大师的下载,提供了一个方式:输入你的手机号码,网易汇给你发放一个带链接的邮件,点此链接可以跳转到应用商店下载,用以解决不方便扫码时的情况。这里会让我们输入验证码,看了下开发者工具,发现一个奇怪的现象。preview里面显示的是一个验证码图片,response中却没有任何内容。打破了我固有的认识,之前以为返回的也是一张jpg或者其他格式的图片。(后来想想,这样不利于后台对用户输入验证码的验证。

Katios 1万+

python-爬虫:获取163邮箱的收件箱信息列表

在练习python爬虫的时候看到了原博主的关于爬取163邮箱收件箱信息列表的文章,就拿来练手了。这里附上原博客链接https://blog.csdn.net/u011379247/article/details/51019379由于原文用的是python2.X,浏览器的版本也比较早。而本人用的是python3.6,浏览器也是新版本,所以还是有些不一样的地方值得摸索的。主要内容:1. 模拟163邮箱...

sixu_9days的博客 2万+
上一篇: 3分钟Python爬取9000张表情包图片
下一篇: Python入门级爬虫教材,获取天天基金网站的基金数据
Python_sn
博客等级 码龄6年 326粉丝 290原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址