 |
|
 |
Hi!
I'm trying see all new messages, but after I use FetchMessage, the library mark message as read .
I see thread of "Marking message as read", Rohit talk about EXAMINE instead of SELECT, but library still mark as read...
MyCode:
' In a Button IMAPServer.Login(My.Settings.ServidorIMAP, My.Settings.Usuario, txtSenha.Text) IMAPServer.ExamineFolder("INBOX")
' Another Button Dim xml As Xml.XmlTextWriter NewMails = New System.Collections.ArrayList IMAPServer.SearchMessage(SearchString, True, CurrentMails) Dim test As New System.Collections.ArrayList ' As String = "" If Not (CurrentMails.Equals(PastMails)) Then For Each UIDMail As String In CurrentMails If (Not UIDMail.Equals("") And PastMails.IndexOf(UIDMail) < 0) Then xml = New Xml.XmlTextWriter(UIDMail & ".txt", System.Text.Encoding.UTF8) IMAPServer.FetchMessage(UIDMail, xml, True) xml.Close End If Next End If
if after I execute the code, I open my account in Outlook and execute "Send/Receive" to get new message, it retrieve all messages as read. if I dont exec it retrieve unread messages..
any idea??
Thank You.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi!
I solved adding this method in library.
void RemoveMessageFlags(string sMessageUID, string flags) { ImapResponseEnum eImapResponse = ImapResponseEnum.IMAP_SUCCESS_RESPONSE; string sCommandSuffix = ""; sCommandSuffix = sMessageUID + ":" + sMessageUID + " -FLAGS " + flags;// "BODY[" + sPartNumber + "]"; string sCommandString = "STORE " + sCommandSuffix + IMAP_COMMAND_EOL ;
try { //----------------------- // SEND SEARCH REQUEST ArrayList asResultArray = new ArrayList(); eImapResponse = SendAndReceive(sCommandString, ref asResultArray); if (eImapResponse != ImapResponseEnum.IMAP_SUCCESS_RESPONSE) { throw new ImapException(ImapException.ImapErrorEnum.IMAP_ERR_FETCHMSG, sCommandSuffix); } } catch (ImapException e) { LogOut(); throw e; } }
Call:
RemoveMessageFlags(1234,@"\SEEN"); This mark message as UNREAD.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I suspect, it uses different connection for login/search versus fetch messages. Can you please try same thing with ImapLibraryTest.exe from ImapTestLibrary/bin/debug folder and send me the log? Infact, I just tried with ImapLibraryTest.exe where login, examine folder (note down unseen message count), search messages and fetch header with body=true, logout, login, examine, here unseen message count should not change.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
i m trying it but when it is not connected give the connection error..wht i do ...can we implement in asp.net so that it can be fast and more fast plz reply me i need very urgent ...
|
| Sign In·View Thread·PermaLink | 2.33/5 (3 votes) |
|
|
|
 |
|
|
 |
|
 |
First you need to see the flag \Deleted for the uid and than execute EXPUNGE in that folder which will delete the message. EXPUNGE is not for the UID rather folder.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I did that but i dont get response from the server.
IMAP005 UID STORE 25 +FLAGS (\Deleted) * 1 FETCH (FLAGS (\Seen \Deleted) UID 25) IMAP005 OK STORE completed.
IMAP006 EXPUNGE
After Expunge command it hangs in SendReceive Method at this line. string sResult = m_useSSL ? m_rdr.ReadLine() : m_oRdStrm.ReadLine();
Secondly, Is there a way to search for only subject text along with unseen messages? I get result by subject text but i need to filter with unseen flag.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
I opened the solution in VS 2003 and build the solutin which created ImapLibrary.dll.
I started new project and refereneced the dll, now, How do I call the methods? My new project is vb.net.
I would like to login the read email and save attachements.
Can you please help?
Thank You.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Below are the headers from an email stored in Dovecot. I am trying to use this library to retrieve this message. I tried using <20090409220001.7FC9310070@c5devbillk-mail.sky.dom> but it did not work. Can anyone help? I am looking for a way to fetch a message with its unique id.
Return-Path: <root@c5devbillk-mail.sky.dom> X-Original-To: postmaster@c5devbillk-mail.sky.dom Delivered-To: postmaster@c5devbillk-mail.sky.dom Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by c5devbillk-mail.sky.dom (Postfix) with SMTP id C018C1006E; Thu, 9 Apr 2009 15:00:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on c5devbillk-mail.sky.dom X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED,AWL autolearn=ham version=3.2.4 X-Virus-Scanned: amavisd-new at example.com Received: from c5devbillk-mail.sky.dom ([127.0.0.1]) by localhost (c5devbillk-mail.sky.dom [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YCnYqJxNuHHq; Thu, 9 Apr 2009 15:00:01 -0700 (PDT) Received: by c5devbillk-mail.sky.dom (Postfix, from userid 0) id 7FC9310070; Thu, 9 Apr 2009 15:00:01 -0700 (PDT) From: root@c5devbillk-mail.sky.dom (Cron Daemon) To: root@c5devbillk-mail.sky.dom, postmaster@c5devbillk-mail.sky.dom, webmaster@c5devbillk-mail.sky.dom, clamav@c5devbillk-mail.sky.dom Subject: Cron <root@c5devbillk-mail> /usr/share/clamav/freshclam-sleep Content-Type: text/plain; charset=UTF-8 Auto-Submitted: auto-generated X-Cron-Env: <MAILTO=root,postmaster,webmaster,clamav> X-Cron-Env: <SHELL=/bin/sh> X-Cron-Env: <HOME=/root> X-Cron-Env: <PATH=/usr/bin:/bin> X-Cron-Env: <LOGNAME=root> X-Cron-Env: <USER=root> Message-Id: <20090409220001.7FC9310070@c5devbillk-mail.sky.dom> Date: Thu, 9 Apr 2009 15:00:01 -0700 (PDT)
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
UID is not part of the message. It is a unique ID associated with message at server side. It is created by the server and assign to the message. It is valid as long as message exist.
You can find UID for above message by searching either Message-Id or other header fields like from, to, subject date etc..
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hey, We recently began having problems with an application using this library at one of our production servers after upgrading our cyrus-imap MTA.
The exception our program is returning is the following:
Joshi.Utils.Imap.ImapException: Failure fetching message from IMAP folder/mailbox.
So I took a look at a traffic dump and I found the following:
REQUEST: IMAP FETCH BODY[1]
and the server is only responding:
IMAP OK Completed (0.000 sec)
But no message.
Any ideas on what might be going on here? Thanks for your help.
Ps. Imap server works fine.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Can you please snoop the data and send it to me so I will know what's happening? Also try fetching simple text message without an attachment and see that work than we can look into detail.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi every 1, i m stuck into a problem. i m accessing the exchange server to show the inbox. I am able to connect but when I am trying to read the data, it is show the error--
"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.".
here is the piece of code- m_oImapServ = new TcpClient(sHost, nPort); m_oNetStrm = m_oImapServ.GetStream(); m_oRdStrm = new StreamReader(m_oImapServ.GetStream()); if (m_oImapServ.Connected == true) { m_oImapServ.SendBufferSize= 2000; string sResult = m_oRdStrm.ReadLine(); //error is being generated at this line. if (sResult.StartsWith(IMAP_OK_SERVER_RESPONSE) == true) { Log(LogTypeEnum.IMAP, sResult); eImapResponse = ImapResponseEnum. IMAP_SUCCESS_RESPONSE; Capability(); } else { Log(LogTypeEnum.IMAP, sResult); eImapResponse = ImapResponseEnum. IMAP_FAILURE_RESPONSE; } }
i used the same code which i hv downloaded frm here. so please if any1 could help me......
thanks in advance
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
heyy Rohit,gr8 work i just want to ask if i can connect to hotmail or yahoo?? because i tried their host and i failed to connect
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
SSL is not supported so that might be an issues.
NOTE: hotmail is not supported as it doesn't provide IMAP access. It has it's own web based protocol.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
bool ParseBodyStructure(string sMessageUID, ref string sBodyStruct, XmlTextWriter oXmlBodyPart, string sPartPrefix, bool bFetchBody)
It was impossibile read data of singlepart email... and i resolve this problem in this way:
//mancava un pezzo son diventato scemo!! try { string sData = ""; GetBody(sMessageUID, "1", ref sData); if (sData.Length > 0 && ((sData.ToLower()).IndexOf(IMAP_MESSAGE_CONTENT_TYPE.ToLower()) == -1)) { oXmlBodyPart.WriteElementString("DATA", sData); } } catch (ImapException e) { return false; }
} else // MULTIPART {
before multipart mode--> else // MULTIPART I add the code to fill sdata and in this way the output for singlepart message is ok. Without this code the library can't output the text of singlepart email Bye bye
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi, after including the code, i am getting the problem. But it is going to read single part mails but fails for multi-part mails. Can a have brief notes on this. It is very urgent for me. I am implementing the same kind of work, like reading message from the IMAP and store into XML then saving into different Databases (basing on user requirement). If u have the right source code please provide me so that it can be helpful to me.  Regards RAM
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Hello, I am in your same situation! I saw that the library does not read the body of singlepart text\plain email and I added that part of code, but I am not sure that I made the right choice ...
Another problem: I saw that if a multipart email contains HTML code and unfortunately it contains the tag <html> <meta content="text/html; charset=utf-8" http-equiv="content-type" /> does not add as part 
bye bye </html>
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
hi, even commenting the line "&&((sData.ToLower ()). indexOf (IMAP_MESSAGE_CONTENT_TYPE.ToLower ()) == -1))" i am getting the error as follows.
Error:Invalid size in Response * 10 FETCH (BODY[1.1] "" UID 105). Error:UnKnow Exception:
and also it is not creating the XML file. Any solution to this.
THANKs & REGARDs RAM
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi Rohit/Jason, i just downloaded and using your imap client library. But when i am trying to read messages coming from yahoo & Hotmail sites its giving errors like "Failed to get Content-Type." But Actually Its Reading the message from the server but not writing on the XML file. Can i have any tips for this.
when i am debugging its moving into "ParseQuotedString()" and returning "Invalid Body Structure" . give me some suggestions on this. thanks & regards anjana durga
modified on Monday, September 15, 2008 2:53 AM
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |