知道邮箱的账号密码!可不可以通过程序得到该邮箱信息?

abirdtofly 2012-03-07 11:01:01
以qq邮箱为例好了!前提:知道用户名密码;能不能获取该邮箱的未读邮件等等?asp.net实现!
...全文
541 27 打赏 收藏 转发到动态 举报
写回复
用AI写文章
27 条回复
切换为时间正序
请发表友善的回复…
发表回复
abirdtofly 2012-03-14
  • 打赏
  • 举报
回复
结贴给分!辛苦给位了!最后解决方案:Jmail实现!因为实际Jmail的很多注意事项!代买就不贴了!有需要的童鞋可以联系我!QQ:1009968647
abirdtofly 2012-03-09
  • 打赏
  • 举报
回复
[Quote=引用 25 楼 zaocha321 的回复:]

[/Quote]
为啥没人呢
狼王_ 2012-03-09
  • 打赏
  • 举报
回复
abirdtofly 2012-03-09
  • 打赏
  • 举报
回复
别沉了!大神们来个asp.net的!
abirdtofly 2012-03-08
  • 打赏
  • 举报
回复
[Quote=引用 19 楼 amy19830704 的回复:]

VB.NET code

Imports System.IO
Imports System.Net
Imports System.Net.Sockets

Public Class Form1

Private Function Connect(ByVal strServer As String, ByVal strUser As String, ByVal strPwd As Str……
[/Quote]
这个这个表示压力很大!
吟月轻舞 2012-03-08
  • 打赏
  • 举报
回复

Imports System.IO
Imports System.Net
Imports System.Net.Sockets

Public Class Form1

Private Function Connect(ByVal strServer As String, ByVal strUser As String, ByVal strPwd As String) As NetworkStream
Dim Sender As New TcpClient(strServer, 110)
Dim OutBytes As Byte()
Dim input As String
Dim Ns As NetworkStream = Nothing

Try
Ns = Sender.GetStream()
Dim sr As New StreamReader(Ns, System.Text.Encoding.GetEncoding("gb2312"))
input = "user " & strUser & vbCrLf
OutBytes = System.Text.Encoding.ASCII.GetBytes(input)
Ns.Write(OutBytes, 0, OutBytes.Length)
Console.WriteLine(sr.ReadLine())
input = "pass " & strPwd & vbCrLf
OutBytes = System.Text.Encoding.ASCII.GetBytes(input)
Ns.Write(OutBytes, 0, OutBytes.Length)
Console.WriteLine(sr.ReadLine())
Console.WriteLine("==========================================================")
Return Ns
Catch ex As Exception
MsgBox("无法连接到服务器", MsgBoxStyle.Critical)
Return Ns
End Try
End Function

Private Function GetNumberOfNewMessages() As Integer
Dim OutBytes As Byte()
Dim input As String
Dim strTemp As String

GetNumberOfNewMessages = -1
Try
Dim Ns As NetworkStream = Connect("pop3.163.com", "username", "password") '这里输入你自己的用户名和密码
If (Ns Is Nothing) Then Exit Function
Dim sr As New StreamReader(Ns, System.Text.Encoding.GetEncoding("gb2312"))

input = "stat" & vbCrLf
OutBytes = System.Text.Encoding.ASCII.GetBytes(input)
Ns.Write(OutBytes, 0, OutBytes.Length)
Dim resp As String = sr.ReadLine()
Console.WriteLine(resp)
MsgBox(resp)
Dim tokens As String() = resp.Split(" ")


input = "UIDL 3" & vbCrLf
OutBytes = System.Text.Encoding.ASCII.GetBytes(input)
Ns.Write(OutBytes, 0, OutBytes.Length)
resp = sr.ReadLine
Console.WriteLine(resp)
MsgBox("Uidl:" & resp)

input = "RETR 3" & vbCrLf
OutBytes = System.Text.Encoding.ASCII.GetBytes(input)
RichTextBox1.Text = "请稍候.."
RichTextBox1.Refresh()

Dim wenzhou As String = ""
Do
Ns.Write(OutBytes, 0, OutBytes.Length)
Console.WriteLine(resp)
resp = sr.ReadLine
wenzhou &= resp & vbCrLf
Loop While resp <> "."
RichTextBox1.Text = wenzhou

input = "quit" & vbCrLf
OutBytes = System.Text.Encoding.ASCII.GetBytes(input)
Ns.Write(OutBytes, 0, OutBytes.Length)
Console.WriteLine(sr.ReadLine())
sr.Close()
Ns.Close()

Return Val(tokens(1))
Catch ex As Exception
Console.WriteLine(ex.ToString)
End Try
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim intNew As Integer
intNew = GetNumberOfNewMessages()
MsgBox("有" & CStr(intNew) & "封新邮件!")
End Sub

End Class
abirdtofly 2012-03-08
  • 打赏
  • 举报
回复
求帮助
abirdtofly 2012-03-08
  • 打赏
  • 举报
回复
[Quote=引用 21 楼 amy19830704 的回复:]

VB.NET和C#有那么大的差异么?。。。。
C# code

using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Net;
using Syste……
[/Quote]
辛苦!我转成asp.net还是很累!没转成功!不过谢谢了!哈哈!
abirdtofly 2012-03-08
  • 打赏
  • 举报
回复
[Quote=引用 21 楼 amy19830704 的回复:]

VB.NET和C#有那么大的差异么?。。。。
C# code

using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Net;
using Syste……
[/Quote]
对我我这样的菜鸟来说有点大!我先改改你后面这个!
吟月轻舞 2012-03-08
  • 打赏
  • 举报
回复
VB.NET和C#有那么大的差异么?。。。。

using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Net.Sockets;

public class Form1
{

private NetworkStream Connect(string strServer, string strUser, string strPwd)
{
TcpClient Sender = new TcpClient(strServer, 110);
byte[] OutBytes = null;
string input = null;
NetworkStream Ns = null;

try {
Ns = Sender.GetStream();
StreamReader sr = new StreamReader(Ns, System.Text.Encoding.GetEncoding("gb2312"));
input = "user " + strUser + Constants.vbCrLf;
OutBytes = System.Text.Encoding.ASCII.GetBytes(input);
Ns.Write(OutBytes, 0, OutBytes.Length);
Console.WriteLine(sr.ReadLine());
input = "pass " + strPwd + Constants.vbCrLf;
OutBytes = System.Text.Encoding.ASCII.GetBytes(input);
Ns.Write(OutBytes, 0, OutBytes.Length);
Console.WriteLine(sr.ReadLine());
Console.WriteLine("==========================================================");
return Ns;
} catch (Exception ex) {
Interaction.MsgBox("无法连接到服务器", MsgBoxStyle.Critical);
return Ns;
}
}

private int GetNumberOfNewMessages()
{
int functionReturnValue = 0;
byte[] OutBytes = null;
string input = null;
string strTemp = null;

functionReturnValue = -1;
try {
NetworkStream Ns = Connect("pop3.163.com", "username", "password");
//这里输入你自己的用户名和密码
if ((Ns == null))
return functionReturnValue;
StreamReader sr = new StreamReader(Ns, System.Text.Encoding.GetEncoding("gb2312"));

input = "stat" + Constants.vbCrLf;
OutBytes = System.Text.Encoding.ASCII.GetBytes(input);
Ns.Write(OutBytes, 0, OutBytes.Length);
string resp = sr.ReadLine();
Console.WriteLine(resp);
Interaction.MsgBox(resp);
string[] tokens = resp.Split(" ");


input = "UIDL 3" + Constants.vbCrLf;
OutBytes = System.Text.Encoding.ASCII.GetBytes(input);
Ns.Write(OutBytes, 0, OutBytes.Length);
resp = sr.ReadLine();
Console.WriteLine(resp);
Interaction.MsgBox("Uidl:" + resp);

input = "RETR 3" + Constants.vbCrLf;
OutBytes = System.Text.Encoding.ASCII.GetBytes(input);
RichTextBox1.Text = "请稍候..";
RichTextBox1.Refresh();

string wenzhou = "";
do {
Ns.Write(OutBytes, 0, OutBytes.Length);
Console.WriteLine(resp);
resp = sr.ReadLine();
wenzhou += resp + Constants.vbCrLf;
} while (resp != ".");
RichTextBox1.Text = wenzhou;

input = "quit" + Constants.vbCrLf;
OutBytes = System.Text.Encoding.ASCII.GetBytes(input);
Ns.Write(OutBytes, 0, OutBytes.Length);
Console.WriteLine(sr.ReadLine());
sr.Close();
Ns.Close();

return Conversion.Val(tokens[1]);
} catch (Exception ex) {
Console.WriteLine(ex.ToString());
}
return functionReturnValue;
}
private void Button1_Click(System.Object sender, System.EventArgs e)
{
int intNew = 0;
intNew = GetNumberOfNewMessages();
Interaction.MsgBox("有" + Convert.ToString(intNew) + "封新邮件!");
}

}
abirdtofly 2012-03-07
  • 打赏
  • 举报
回复
[Quote=引用 15 楼 wjsdjga 的回复:]

完全免费 实现收发邮件
[/Quote]
仁兄所指是?
铜臂阿铁木 2012-03-07
  • 打赏
  • 举报
回复
真心能。前提 qq邮箱开了收件服务。
wjsdjga 2012-03-07
  • 打赏
  • 举报
回复
完全免费 实现收发邮件
吟月轻舞 2012-03-07
  • 打赏
  • 举报
回复
[Quote=引用 12 楼 abirdtofly 的回复:]

引用 10 楼 amy19830704 的回复:

Jmail插件的专业版(收费版本),需要在服务器安装才能调用

具体的写法你可以在网上搜索“Jamil收邮件”,很多这样的代码

收费就算了!同样感谢
[/Quote]

自己测试网上有破解版的Jmail Pro下载,一般正规的空间服务商安装的就是专业版的,支持接收邮件。

http://topic.csdn.net/u/20090921/11/f3b9077b-4eda-4e80-ae69-ded9ad60a147.html
这里有个帖子你也可以参考下,不过代码我没测试过
abirdtofly 2012-03-07
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 caozhy 的回复:]

要么支持pop3等协议,要么支持web mail,并且没有过于复杂的验证码。
[/Quote]
细说?
abirdtofly 2012-03-07
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 amy19830704 的回复:]

Jmail插件的专业版(收费版本),需要在服务器安装才能调用

具体的写法你可以在网上搜索“Jamil收邮件”,很多这样的代码
[/Quote]
收费就算了!同样感谢
threenewbee 2012-03-07
  • 打赏
  • 举报
回复
要么支持pop3等协议,要么支持web mail,并且没有过于复杂的验证码。
吟月轻舞 2012-03-07
  • 打赏
  • 举报
回复
Jmail插件的专业版(收费版本),需要在服务器安装才能调用

具体的写法你可以在网上搜索“Jamil收邮件”,很多这样的代码
abirdtofly 2012-03-07
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 wxr0323 的回复:]
引用 6 楼 abirdtofly 的回复:

引用 3 楼 sunzongbao2007 的回复:

引用 2 楼 abirdtofly 的回复:

引用 1 楼 sunzongbao2007 的回复:

真心能。前提 qq邮箱开了收件服务。

求例子!!

很多的,各种搜啊。

各种搜不到!

GO
[/Quote]
java的表示用不上!
子夜__ 2012-03-07
  • 打赏
  • 举报
回复

[Quote=引用 6 楼 abirdtofly 的回复:]

引用 3 楼 sunzongbao2007 的回复:

引用 2 楼 abirdtofly 的回复:

引用 1 楼 sunzongbao2007 的回复:

真心能。前提 qq邮箱开了收件服务。

求例子!!

很多的,各种搜啊。

各种搜不到!
[/Quote]
GO
加载更多回复(6)

62,047

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧