自动删除电子邮件
问题:
我正在寻找一种方法来创建一个程序,该程序访问电子邮件主机站点并使用特定凭据登录,并删除收件箱中的所有邮件并清除垃圾箱文件夹。
背景:
我有一封带有我的域的电子邮件,并且该电子邮件托管在某个 ISP 服务器上。然而,我已经启用了将所有电子邮件自动转发到我的 gmail,问题是没有自动删除到达邮件的选项,因此我的收件箱的大小有限(10MB)已满,我停止接收电子邮件。直到今天我的解决方案是当我记得或有人打电话给我并问我为什么我的收件箱已满时手动清空它。 ISP 说,为了克服这个问题,我应该在他们的服务器上升级我的 qouta,每月支付一些额外的费用,但我不会这样做。
所以我正在寻找一种自动执行此操作的方法。作为初学者程序,我的印象是编写一个脚本来执行此操作并在每次系统启动时运行。我的系统是 Windows 7,所以我想用 VBScript 来解决。
这是我第一次使用 VBScript,因此欢迎提出任何建议。 另一方面如果您认为有比 VBScript 更好的方法来做到这一点,请告诉我:)我更喜欢编写一个我完全理解的程序,所以我的编程经验是:Pascal/ C/C++/Java/C#/ML/Prolog/Squeak(smalltalk)/TCSH(CShell)。
提前致谢, 扎里尔
The Problem:
I'm looking for a way to create a program that visits an email host site and log in with a specific credentials and deletes all message at the Inbox and clears the Trash folder.
Background:
I have an email with my domain and that email is hosted on some ISP server. However I have enabled auto-forward all my emails to my gmail, the thing is that there is no option for auto deleting arriving messages so my inbox with its limited size (10MB) gets full and I stop receiving emails. My solution till today was to empty it manually when I remember to or when someone calls me and asks me why my inbox is full. The ISP said that in order to overcome this problem I should upgrade my qouta at their server for some extra $$ per month and Its a thing that I won't do.
So I'm looking for a way to do this automatically. My impressions as beginner program is to write a script that does that and runs at every system start. My system would be Windows 7, so I thought to work it out with VBScript.
It would be my first experience with VBScript, so any suggestions would be welcomed. On the other hand if you think there is a better way to do that rather than VBScript tell me :) I prefer to write a program that I fully understand, so my experience in programming would be: Pascal/C/C++/Java/C#/ML/Prolog/Squeak(smalltalk)/TCSH(CShell).
Thanks in advance,
Jalil
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
取决于您使用的电子邮件服务器,但如果您具有 POP3 访问权限,您真正需要做的就是使用 TCP\IP 连接来连接到它并发送一些简单的命令。因此,任何拥有良好库来进行简单连接的语言都应该没问题。
下面我将展示如何仅使用 telnet 来完成此操作(但在互联网上执行此操作时要小心,因为它不使用安全连接):
您所需要做的就是创建一个连接并按顺序发送这些命令(等待响应并检查它是否是
+
或-
以了解是否正常)。关于语言,如果您确实想使用脚本语言,我会考虑 Powershell,因为我认为它支持 .Net 框架类,因此非常容易做到。
Depends on what email server you use but if you have POP3 access all you really need to do is to connect to it with a TCP\IP connection and send some simple commands. So any language where you have a good library for making a simple connection should be fine.
Below I show how you could do it just using telnet (be careful doing this over the internet though since it's not using a secure connection):
All you need to do is to create a connection and send those commands in that order (waiting for the response and checking if it was
+
or-
to know if it went ok or not).Regarding language, if you do want to use a script language I'd consider Powershell since I think that supports the .Net framework classes and so would be really easy to do.
此链接 可能有用。如果帐户使用 POP3,您可以通过 Telnet 连接,并通过这种方式删除邮件。
This link might be useful. If the account uses POP3 you can connect via Telnet, and delete the messages that way.