pop3

How to retrieve gmail sub-folders/labels using POP3?

本秂侑毒 提交于 2019-12-30 11:06:39
问题 The code below uses javamail API to access gmail, String host = "pop.gmail.com"; int port = 995; Properties properties = new Properties(); properties.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); final javax.mail.Session session = javax.mail.Session.getInstance(properties); store = session.getStore("pop3s"); store.connect(host, port, mCredentialaNme, mCredentialApss); // *************************************************************** Folder personalFolders[] = store

.net pop3 over http proxy

霸气de小男生 提交于 2019-12-25 06:25:22
问题 so, i got mailsystem.net from codeplex(http://mailsystem.codeplex.com/), to write pop3 client. problem is, i want to use http proxy. found some hints at: How to open socket thru proxy server in .Net C#? and here is my code: Pop3Client pop = new Pop3Client(); Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); sock.Connect("79.172.35.74", 82); // here is proxy sock.Send(Encoding.UTF8.GetBytes("CONNECT pop.yandex.ru:110 HTTP/1.1<CR><LF>")); // here pop3

POP3收取邮件

冷暖自知 提交于 2019-12-25 02:59:32
SMTP用于发送邮件,如果要收取邮件呢? 收取邮件就是编写一个MUA作为客户端,从MDA把邮件获取到用户的电脑或者手机上。收取邮件最常用的协议是POP协议,目前版本号是3,俗称POP3. Python内置一个poplib模块,实现了POP3协议,可以直接用来收邮件。 注意到POP3协议收取的不是一个已经可以阅读的邮件本身,而是邮件的原始文本,这和SMTP协议很像,SMTP发送的也是经过编码后的一大段文本。 要把POP3收取的文本编程可以阅读的邮件,还需要用email模块提供的各种类来解析原始文本,变成可阅读的邮件对象。 所以,收取邮件分为两步: 第一步:用poplib把邮件的原始文本下载到本地; 第二步:用email解析原始文本,还原为邮件对象。 通过POP3下载邮件 POP3协议本身很简单,以下面的代码为例,我们来获取最新的一封邮件内容: import poplib # 输入邮件地址,口令和POP3服务器地址 email = input('Email: ') password = input('Password: ') pop3_server = input('POP3 server: ') # 连接到POP3服务器 server = poplib.POP3(pop3_server) # 可以打开或关闭调试信息 server.set_debuglevel(1) # 可选

Receive messages from gmail

假装没事ソ 提交于 2019-12-25 02:19:27
问题 I try to receive messages from gmail account but get an error: host not found . Here is my code: using (TcpClient client = new TcpClient("pop.gmail.com ", 995)) using (NetworkStream n = client.GetStream()) { ReadLine(n); // Read the welcome message. SendCommand(n, "my_login@gmail.com"); SendCommand(n, "my_password"); SendCommand(n, "LIST"); // Retrieve message IDs List<int> messageIDs = new List<int>(); while (true) { string line = ReadLine(n); // e.g. "1 1876" if (line == ".") break;

How to get PlainText or Html Text using AE.Net.Mail?

北城余情 提交于 2019-12-24 09:15:52
问题 I'm trying to get Plain Text or HTML Text of email using AE.Net.Mail. I cannot find any documentation. using (Pop3Client pop3 = new AE.Net.Mail.Pop3Client("pop3Server", "login", "pwd", 995, true)) { for (var i = pop3.GetMessageCount() - 1; i >= 0; i--) { MailMessage Msg = pop3.GetMessage(i); string HtmlText = Msg.?????? string PlainText = Msg.?????? } } Edit : I found this solution IList<Attachment> iList; string HtmlText = "", PlainText = ""; for (var i = pop3.GetMessageCount() - 1; i >= 0;

How to connect/telnet to SPOP3 server using java (Sockets)?

家住魔仙堡 提交于 2019-12-24 08:35:53
问题 In case of POP3 it is possible to connect via telnet using sockets over port 110, But how to do it , if SPOP3 is implemented. With normal telnet it can be done quite easily with Socket pop3Socket = new Socket(host.com, 110); FYI: For connecting to SPOP3 we use in linux/unix openssl s_client -connect servername.com:995 回答1: You'll need to use the SSLSocket class. An example can be found at: http://www.herongyang.com/JDK/SSL-Socket-Client-Example-SslSocketClient.html. Basically, you'll do

Why does JavaMail BodyPart.getInputStream() return an empty stream when using IMAP, but not when using POP3?

匆匆过客 提交于 2019-12-24 07:06:42
问题 I have a javax.mail application that parses through emails and gets the InputStream for all application/* attachments: private DataInputStream getAttachmentStream(Message message) throws MessagingException, IOException { if (message.isMimeType("multipart/*")) { Multipart mp = (Multipart) message.getContent(); for (int p = 0; p < mp.getCount(); p++) { BodyPart part = mp.getBodyPart(p); if (part.getContentType().toLowerCase().startsWith("application")) { InputStream is = part.getInputStream();

Why do i get this exception?

偶尔善良 提交于 2019-12-24 05:21:23
问题 This method gives the number of emails in the inbox.But it gives me this exception : javax.mail.MessagingException: Connect failed; nested exception is: java.net.ConnectException: Connection timed out: connecterror - Session session = Session.getInstance(new Properties()); try { Store store = session.getStore("pop3"); store.connect("pop.gmail.com" , "username" , "password"); Folder fldr = store.getFolder("INBOX"); fldr.open(Folder.READ_WRITE); int count = fldr.getMessageCount(); System.out

Why do i get this exception?

给你一囗甜甜゛ 提交于 2019-12-24 05:21:08
问题 This method gives the number of emails in the inbox.But it gives me this exception : javax.mail.MessagingException: Connect failed; nested exception is: java.net.ConnectException: Connection timed out: connecterror - Session session = Session.getInstance(new Properties()); try { Store store = session.getStore("pop3"); store.connect("pop.gmail.com" , "username" , "password"); Folder fldr = store.getFolder("INBOX"); fldr.open(Folder.READ_WRITE); int count = fldr.getMessageCount(); System.out