访问gmail imap [英] accessing gmail imap
本文介绍了访问gmail imap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
dummy = Encoding.ASCII.GetBytes("$ XLIST \"\" \"*\" \r\n");
byte[] dummy ;
System.Net.Sockets.TcpClient tcpc = new System.Net.Sockets.TcpClient("imap.gmail.com", 993);
System.Net.Security.SslStream ssl = new System.Net.Security.SslStream(tcpc.GetStream());
ssl.Write(dummy, 0, dummy.Length);
buffer = new byte[2048];
bytes = ssl.Read(buffer, 0, 2048);
ssl.Flush();
dummy = Encoding.ASCII.GetBytes("$ LOGOUT \r\n");
ssl.Write(dummy, 0, dummy.Length);
- 这个命令不起作用 - 我可以使用用户名和密码登录gimap
但是我无法执行任何命令
我变坏了不解析命令 - 来自gimap的消息
-- this command is not working --i can login into gimap using username and password
but im not able to execute any commands
im getting bad could not parse command -- message from gimap
推荐答案
XLIST \\\* \\\\\ n );
byte [] dummy;
System.Net.Sockets.TcpClient tcpc = new System.Net.Sockets.TcpClient( imap.gmail.com, 993 );
System.Net.Security.SslStream ssl = new System.Net.Security.SslStream( tcpc.GetStream());
ssl.Write(dummy, 0 ,dummy.Length);
buffer = new byte [ 2048 ];
bytes = ssl.Read(buffer, 0 , 2048 );
ssl.Flush();
dummy = Encoding.ASCII.GetBytes(
XLIST \"\" \"*\" \r\n"); byte[] dummy ; System.Net.Sockets.TcpClient tcpc = new System.Net.Sockets.TcpClient("imap.gmail.com", 993); System.Net.Security.SslStream ssl = new System.Net.Security.SslStream(tcpc.GetStream()); ssl.Write(dummy, 0, dummy.Length); buffer = new byte[2048]; bytes = ssl.Read(buffer, 0, 2048); ssl.Flush(); dummy = Encoding.ASCII.GetBytes("
LOGOUT \\ \\r\\\
跨度>);
ssl.Write(dummy, 0 ,dummy.Length);
LOGOUT \r\n"); ssl.Write(dummy, 0, dummy.Length);
- 这个命令不起作用 - 我可以使用用户名和密码登录gimap
但是我无法执行任何命令
我变坏了不解析命令 - 来自gimap的消息
-- this command is not working --i can login into gimap using username and password
but im not able to execute any commands
im getting bad could not parse command -- message from gimap
这篇关于访问gmail imap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文