高分求~163邮箱自动登录代码,只实现登录部分即可,(VC++) RT 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 登陆部分不难 没有验证码 直接抓包 按格式填好用户名密码 POST数据过去 获取返回的Cookie 在发送一个GET请求就行了 刚抓包看了一下 只用POST提交一次数据而已 你也可以越过web界面,直接去和smtp.163.com交互。可以找一个smtp客户端类来用 还是建议用SMTP做 我因为做习惯了POST GET... 没想到用那个 用 底层 socket API 连接 :若接收邮件:pop3.163.com 端口 110(不过163的邮箱普通用户不可以使用此项服务)若发送邮件:smpt .163.com 端口 25以登陆SMtp.163.com实例:::AfxAppPara.AfxSmtpSocket = socket(AF_INET, SOCK_STREAM, 0);::AfxAppPara.AfxSmtpSin.sin_addr.s_addr = inet_addr;(::AfxAppPara.AfxUSER.SmtpServerIP);::AfxAppPara.AfxSmtpSin.sin_family = AF_INET;::AfxAppPara.AfxSmtpSin.sin_port = htons(25); int Result = ::connect(AfxAppPara.AfxSmtpSocket, (LPSOCKADDR)&AfxAppPara.AfxSmtpSin, sizeof(AfxAppPara.AfxSmtpSin));然后再用recv接受数据并分析,send发送命令send ehlo 打招呼;send auth login 登陆服务器;send userName;send Pass;再或者用MFC中封装好的Socket类库 可以看一下大体的步骤:void CSMTPServerCtrl::SendLoadCmd(){ CString cmd = "ehlo "; cmd += ::AfxAppPara.AfxUSER.UserName; cmd += "\r\n"; CString readInfo; //cmd += AfxUSER.UserName; this->SendCmdToServer(cmd); this->ReadResponceFromServer(readInfo, 1024); // 250 readInfo.Empty(); this->SendCmdToServer("auth login\r\n"); this->ReadResponceFromServer(readInfo, 1024); // encodeLen = 1024; if(!::Base64Encode((const BYTE*)AfxAppPara.AfxUSER.UserName.GetBuffer( AfxAppPara.AfxUSER.UserName.GetLength()), AfxAppPara.AfxUSER.UserName.GetLength(), (BYTE*)encodeUserName, &encodeLen)) { MessageBox(NULL, "error: username", NULL, MB_OK); return; } encodeUserName[encodeLen + 1] ='\0'; cmd = this->encodeUserName; cmd += "\r\n"; readInfo.Empty(); this->SendCmdToServer(cmd); this->ReadResponceFromServer(readInfo, 1024); if(!::Base64Encode((const BYTE*)::AfxAppPara.AfxUSER.Password.GetBuffer( AfxAppPara.AfxUSER.Password.GetLength()), AfxAppPara.AfxUSER.Password.GetLength(), (BYTE*)this->encodePassword, &this->encodeLen)) { MessageBox(NULL, "error: password", NULL, MB_OK); return; } this->encodePassword[encodeLen + 1] ='\0'; cmd = this->encodePassword; cmd += "\r\n"; readInfo.Empty(); this->SendCmdToServer(cmd); this->ReadResponceFromServer(readInfo, 1024); return;} 谢谢各位好心人~谁能帮我按照二楼ziplj 的方法给个例程啊 只实现登录就可以了 谢谢各位~~ 错了 是一楼的ziplj 的方法给个例程啊 只实现登录就可以了 谢谢各位~~ 我看来看去 觉得还是分析http包比较重要,但是不知道里面的哪些数据时重要的 不懂啊 163登陆不是用的https? 而是http? 如果是https如何抓包?有人知道么? 大家看看我这是怎么了? 求助:使用QT加载全局钩子,只能监测到本窗口的活动 关于对话框重载的问题 散点小分 请问如何给MFC项目添加IApplication接口? 我这一行代码的错误在哪?谢谢,附函数原型 请问ddk中设置文件钩子后可以得到rename后的新的文件名吗?可以捕获新建文件操作吗? 在windows2k 简体上开发的程序如何在 繁体操作系统上正常显示? AF_INET 和 PF_INET有什么区别? 求高手 proe二次开发中vs2008编译的一些问题 第七章:新的开始 高价求中文验证码识别
登陆部分不难 没有验证码 直接抓包 按格式填好用户名密码 POST数据过去 获取返回的Cookie 在发送一个GET请求就行了 刚抓包看了一下 只用POST提交一次数据而已
若接收邮件:pop3.163.com 端口 110(不过163的邮箱普通用户不可以使用此项服务)
若发送邮件:smpt .163.com 端口 25以登陆SMtp.163.com实例:::AfxAppPara.AfxSmtpSocket = socket(AF_INET, SOCK_STREAM, 0);
::AfxAppPara.AfxSmtpSin.sin_addr.s_addr = inet_addr;(::AfxAppPara.AfxUSER.SmtpServerIP);
::AfxAppPara.AfxSmtpSin.sin_family = AF_INET;
::AfxAppPara.AfxSmtpSin.sin_port = htons(25);
int Result = ::connect(AfxAppPara.AfxSmtpSocket,
(LPSOCKADDR)&AfxAppPara.AfxSmtpSin,
sizeof(AfxAppPara.AfxSmtpSin));
然后再用recv接受数据并分析,send发送命令
send ehlo 打招呼;
send auth login 登陆服务器;
send userName;
send Pass;再或者用MFC中封装好的Socket类库
void CSMTPServerCtrl::SendLoadCmd(){
CString cmd = "ehlo ";
cmd += ::AfxAppPara.AfxUSER.UserName;
cmd += "\r\n";
CString readInfo;
//cmd += AfxUSER.UserName; this->SendCmdToServer(cmd);
this->ReadResponceFromServer(readInfo, 1024); // 250
readInfo.Empty();
this->SendCmdToServer("auth login\r\n");
this->ReadResponceFromServer(readInfo, 1024); // encodeLen = 1024;
if(!::Base64Encode((const BYTE*)AfxAppPara.AfxUSER.UserName.GetBuffer(
AfxAppPara.AfxUSER.UserName.GetLength()),
AfxAppPara.AfxUSER.UserName.GetLength(),
(BYTE*)encodeUserName, &encodeLen))
{
MessageBox(NULL, "error: username", NULL, MB_OK);
return;
}
encodeUserName[encodeLen + 1] ='\0';
cmd = this->encodeUserName;
cmd += "\r\n"; readInfo.Empty();
this->SendCmdToServer(cmd);
this->ReadResponceFromServer(readInfo, 1024); if(!::Base64Encode((const BYTE*)::AfxAppPara.AfxUSER.Password.GetBuffer(
AfxAppPara.AfxUSER.Password.GetLength()),
AfxAppPara.AfxUSER.Password.GetLength(),
(BYTE*)this->encodePassword, &this->encodeLen))
{
MessageBox(NULL, "error: password", NULL, MB_OK);
return;
}
this->encodePassword[encodeLen + 1] ='\0';
cmd = this->encodePassword;
cmd += "\r\n"; readInfo.Empty();
this->SendCmdToServer(cmd);
this->ReadResponceFromServer(readInfo, 1024);
return;
}
谁能帮我按照二楼ziplj 的方法给个例程啊 只实现登录就可以了 谢谢各位~~