 |
|
 |
i used imap library and it's worked for me. but now i got an error. it say's "CAPABILITY IMAP4rev1 UNSELECTED LITERAL+IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE" ..
And I found google change their response, before the *OK message they return *CAPABILITY. I can't solve this Problem.
please can some one help me....
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
I am using IMAP library. When I connect to server, the response is coming something like, "220 Mail.servername.co.in Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830 ready at Fri, 6 Nov 2009 11:41:54 +0530 11/6/2009 11:41:54 AM". I think I should get "* OK". Plz help me to solve this issue.
code is: if (sResult.StartsWith(IMAP_OK_SERVER_RESPONSE) == true) // fails { Capability(); }
Reagards Shiva
modified on Friday, November 6, 2009 3:47 AM
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
I have a message with html data.I am using InterIMAP which internally users this IMAP Library.
When i try to retreive from message.htmlData it returns junks characters.
Original Message: Sorry, I wasn’t here Monday.
Modified Message: Sorry, I wasn=92t here Monday.
It also converts double quote to =93 and =94
and a single dash "-" to =96.
Is there a way to fix this? I will be glad to use this IMAP library directly.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
I am trying your code and using gmail imap.gmail.com and my user credentials. but its not loogin in i tried changing the port as gmail listens to 993 port.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Well, the gmail uses also SSL, but this library has nothing implemented for this, it just talk in plain text with the server. So this is why you cannot connect even if had changed the port.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
Can anyone provide snippet how to download the attachments for email. I need to store the attachments into seperate directory after reading the emails.
The attachments can be in tiff or pdf or any image format.
Any help is greatly appreciated.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
You can download any attachment like any part of email. When you call command "FETCH #order FULL" you'll get an BODY definition in response statement. You should calculate the part number from BODY, and use a command like "FETCH BODY[3]". When server receives command, it will send you attachment line by line. Finally, you will decode them and write to database or any file with suitable extension.
|
| Sign In·View Thread·PermaLink | 3.67/5 (3 votes) |
|
|
|
 |
|
 |
Hi again !
how are you ? great
Now, when i received special chars (eg: 'ç', 'á'), instead of having these characters, I have '=E7', '=E1'.
I read about QUOTED-PRINTABLE. Is this ok? But switching QUOTE-PRINTABLE for 7BIT (this appears on message with none special char.) but nothing happen.
this process of change 'ç' for '=E7' is internal of server? we dont have control of this ?
I'm goingo to: .REPLACE .REPLACE .REPLACE .REPLACE, lol I don't want that...
any idea?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
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:
IMAPServer.Login(My.Settings.ServidorIMAP, My.Settings.Usuario, txtSenha.Text) IMAPServer.ExamineFolder("INBOX")
Dim xml As Xml.XmlTextWriter NewMails = New System.Collections.ArrayList IMAPServer.SearchMessage(SearchString, True, CurrentMails) Dim test As New System.Collections.ArrayList 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; string sCommandString = "STORE " + sCommandSuffix + IMAP_COMMAND_EOL ;
try { 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 | |
|
|
|
 |
|
 |
Thank for you reply Rohit.
Log? Where? I try and still mark as read...
I don't have VS2003 in my computer, I build and test in VS2005. But nothing strange ocorred in conversion, complete with sucess. I downloaded again and only exec EXE. Same thing, mark as read...
I found another vs solution (named with ImapLibrary) in my computer (realy,I do not know how to come on my computer lol), but this is with SLL. You know something??
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Can you please try following with ImapLibraryTest.exe from ImapTestLibrary/bin/debug folder and send me the screen capture from terminal?
1. login 2. Examine folder (option e): 3. search messages (e.g from scorpiobra) 4. fetch header with body=true 5. logout 6. exit
7. login 8. examine
I did the same thing and I don't see messages are marked read. when you execute examine, see the number of UNSEEN message count.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
I think I found the issues. See the http://docs.google.com/View?id=dcqwbnvw_34fs9sd4dc[^] .
I did exactly same thing but it didn't change the flag.
But what I noticed difference is when I execute EXAMINE command on my mail server, the permanent flags are empty. but in your case, during examine, it does allow to change flags.
IMAP003 EXAMINE INBOX * FLAGS (\Answered \Flagged \Draft \Deleted \Seen $Voice $Classified $Email $Urg ent) * OK [PERMANENTFLAGS ()] * 15 EXISTS * 0 RECENT * OK [UNSEEN 13] * OK [UIDVALIDITY 1197298831] * OK [UIDNEXT 291] IMAP003 OK [READ-ONLY] Completed
At the end of same document, I have executed SELECT command and now I can see the allowed flags.
MAP003 SELECT INBOX * FLAGS (\Answered \Flagged \Draft \Deleted \Seen $Voice $Classified $Email $Urg ent) * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $Voice $Classifie d $Email $Urgent \*)] * 15 EXISTS * 0 RECENT * OK [UNSEEN 13] * OK [UIDVALIDITY 1197298831] * OK [UIDNEXT 291] IMAP003 OK [READ-WRITE] Completed
Also I looked at the IMAP RFC http://james.apache.org/server/rfclist/imap4/rfc2060.txt[^] for EXAMINE command (section 6.3.2), permanent flags are empty.
So it seems your IMAP server is configured to allow changing flags while examine on folder.
Hope this helps !!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
OK.
Thank you Rohit.
I cannot change server IMAP. I developing a simple check mail. Like a desktop alert of outlook.
I will do as posted before, using RemoveMessageFlag.
I change it
public void RemoveMessageFlags(string sMessageUID, string flags) { ImapResponseEnum eImapResponse = ImapResponseEnum.IMAP_SUCCESS_RESPONSE; string sCommandSuffix = ""; sCommandSuffix = sMessageUID + ":" + sMessageUID + " -FLAGS " + flags; string sCommandString = "UID STORE " + sCommandSuffix + IMAP_COMMAND_EOL ;
try { 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; } }
Now its work fine for me.
Thank for you attention
Brazil Rulez!!!!

|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
It's a hack and lot of overhead. It might be simple configuration on server and easier to fix it. If not than provide that removeflag() as an optional feature so servers which are configured correctly are not impacted. Good Luck !!
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
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 | |
|
|
|
 |