This project is read-only.

This imapX library is a free library or paid ??

Oct 8, 2014 at 2:19 PM
I just want to know that imapX is free or paid library ??

Thank you.
Coordinator
Oct 9, 2014 at 9:06 AM
Hi sauravAnand,

ImapX is a free open source library licensed under Apache License 2.0. You can find a detailed description of the license here: https://imapx.codeplex.com/license.


Greets,

Pavel
Oct 9, 2014 at 10:37 AM
Hi pavel ,

Thank you.
Oct 9, 2014 at 11:36 AM
Hey pavel,

I have used your library to connect with Hotmail by passing "loginEmail"& "accessToken" as credentials and got success. Now i want to connect with gmail, for this i initiated with google api's endpoints to get RequestToken, Authorize URL, and finally access_token & access_token_secret both in one response. Then i used access_token and gmail account loginEmail as credentials for OAuth2Credentials() method :

var credentials = new OAuth2Credentials(accountEmail, access_token); but could'nt login..

In OAuth2Credentials() method, the parameters are OAuth2Credentials ( string login , string authToken )..

So here authToken is stands for ??
Please help me out. If i'm not clear about my query according to you then please let me know what else i'll have to provide you to clear things please.

Thank you.
Oct 9, 2014 at 12:56 PM
Hey pavel,

I want to know that your imapX library will also comfortable with YAHOO MAIL and AOL MAIL ?? I mean i can also search mail messages of YAHOO and AOL ??

Thank you.
Coordinator
Oct 9, 2014 at 11:11 PM
Hi sauravAnand,

first of all, you can always connect to an IMAP server of your choice (including GMail, Yahoo, AOL) by supplying the server address and the login and password. Just like you'd do in Outlook or any other mail software with IMAP support.

If you want to use OAuth2 to access your mailbox on GMail, start by registering your application with Google: https://console.developers.google.com/. You will receive an application id and secret.

When you got your application data, take a look at the sample application provided for ImapX: https://imapx.codeplex.com/releases/view/121634. It has all the code required to use OAuth2 to authenticate on GMail. (e.g GoogleOAuth2Provider)

The authToken parameter of the OAuth2Credentials constructor stands for the access token you have received. Please make sure that you request the right scope when authenticating the user: https://www.googleapis.com/auth/userinfo.email as well as https://mail.google.com/ are required.

Greets,

Pavel
Oct 10, 2014 at 7:05 AM
Hey pavel,

Thanks a ton for your beautiful response and i did the exact way. And for Refresh_token i think have to pass client_id, client_secret,access_token,refresh_token( which i got while processing for access_token first time),response_type ( means its value= "refresh_token").. So this is the right way to get refresh_token ??

Thank you.
Oct 10, 2014 at 7:47 AM
Hey pavel,

Sorry for asking two queries at a time, Now i also want to deal with YAHOO MAIL. For this i goggled and found OAuth1.0 endpoints of yahoo apis like:

https://api.login.yahoo.com/oauth/v2/get_request_token ( by thhis i got oauth_token & oauth_verifier)
https://api.login.yahoo.com/oauth/v2/get_token (this i got oauth_token & oauth_token_secret, yahoo_Guid by passing " oauth_token & oauth_verifier" as parameter in method getAccessToken() )

So if i will use your IMAP then there in place of access_token what i have to pass ??

Can you please provide OAuth 2.0 yahoo endpoints if possible and a way to do further step please ?? OR any working block of code like Gmail's.

Thank you.
Oct 10, 2014 at 8:24 AM
Hey pavel,

I solved first query means about refresh_token . I got fresh access token . Now you please advice me about YAHOO MAIL.

Thank you.
Oct 13, 2014 at 7:49 AM
Hey pavel,

By using username&password i can access YAHOO MAIL easily with the help of your library, But i want to do this by OAuth. So can you please guide me about this ??

I have spent much time on Google to find OAuth 2.0 endpoints for yahoo but found endpoints for OAuth version 1.0 which i mentioned in the prev post.

please help me out.

Thank you.
Coordinator
Oct 14, 2014 at 7:46 PM
Hi sauravAnand,

there's currently only an OAuth2 authentication provider in the library, OAuth 1.0 needs to be implemented manually. I have put it on the feature list and will add support for OAuth 1.0 in the next days.

Greets,

Pavel
Oct 15, 2014 at 6:41 AM
Hey pavel,

Thank you for response. Now i'm fetching Yahoo emails with the help of YQL and OAuth 1.0

But please let me know when your library will be ready to support OAuth 1.0

Thank you.
Oct 15, 2014 at 12:15 PM
Hey pavel,

One thing i also want to know that, in case of search() of your library if i want to search emails by specific date then i can get this by using :
client.Folders.Inbox.Search("SINCE " + date , ImapX.Enums.MessageFetchMode.Full); // And date must be in format of ("dd-MMM-yyyy"), So this is fine with me.

But if i want to search emails by Time (assume since last one hour OR last 30 minutes ) then which format of date time i have to use ??

I tried ("dd-MMM-yyyy hh:MM:ss") but no luck, giving error that this query can't be processed .

Thank you.
Coordinator
Oct 16, 2014 at 8:30 AM
Hi sauravAnand,

the search queries, such as SINCE, only support searching by date, not by time. This is a limitation of the IMAP protocol. So you first need to search by date, and later filter the messages by time on your end.

To always correctly format the date as dd-MMM-yyyy independent from the system culture you can use the following built-in extension:
// Import the extensions namespace
using ImapX.Extensions;

// ... Now whenever you need to format the date as dd-MMM-yyyy for a serach query:
var formattedDateString = dateTime.ToImapDate(); 
Greets,

Pavel
Oct 16, 2014 at 8:51 AM
Hey pavel,

Thanks a ton for your response. I will do as u suggested.

All my work going fine till now, But sometimes i realize that the search( ) takes more than expected time to fetch 8-10 emails. So there is any way to make search faster or get quick results ??

If this is possible to do then please let me know.

Thank you.
Oct 29, 2014 at 6:34 AM
Hey pavel,

We got your post that you are busy and will reply to everyone in coming weekend.

I want to know that i can send or reply to any email by my application ?? Suppose if i want to reply (short reply) to any email after retrieving emails of Gmail account then can i able to do this by writing body text and reply to that sender's email ?? If this possible then please let me know ASAP how to do this using your library.

Thank you.
Coordinator
Oct 29, 2014 at 9:25 AM
Hi sauravAnand,

IMAP is a protocol for receiving e-mails.
If you want to send a message, you can use the built-in SMTP client of the .Net framework.

On how to do it, please refer to this article: Send Email from Yahoo!, GMail, Hotmail (C#).

After you have sent the message using SMTP, you can use the ImapX Folder.AppendMessage to upload it to the Sent folder:
// mailMsg = a System.Net.Mail.MailMessage
// client = ImapX.ImapClient

client.Folders.Sent.AppendMessage(mailMsg);
Greets,

Pavel
Oct 29, 2014 at 9:48 AM
Hey pavel,

Thanks for your quick response.

The article you suggested, in that case i have to use Password also but i don't want to do it by providing password. If User can receive emails by my application then he can send email by the same application,right? So for this if i will ask to user for password then he may not provide. So is there ant way to do it without password??

please help.

thank you.
Oct 31, 2014 at 11:07 AM
Hey pavel,

Till now I have done fetch emails process with Gmail & Hotmail, But when i go for fetching Yahoo mails then it says "The selected authentication mechanism is not supported". And i used OAuth 2.0. here is the linkTEXT.

And here is my code to fetch emails:
var client = new ImapClient("imap.mail.yahoo.com",true);
                    if (client.Connect())
                    {
                        var credentials = new OAuth2Credentials("Someone@yahoo.com", AccessToken);
                        if (client.Login(credentials))        // HERE I GET ERROR "The selected authentication mechanism is not supported"
                        {
                            ImapX.Message[] messages = client.Folders.Inbox.Search("SEEN", ImapX.Enums.MessageFetchMode.Full);
                        }
                    }
So is there any way to resolve this ? where is the fault?
Please let me know ASAP.

Thank you.
Coordinator
Nov 1, 2014 at 6:10 PM
Hi sauravAnand,

yahoo is using OAuth1, which is not yet implemented in the current version of the library (only OAuth2 is supported out of the box), which we discussed before. There was a low demand for this feature, however, it will be available soon.

Greets,

Pavel
Nov 3, 2014 at 5:10 AM
Hey pavel,

Thank you for your response.

I agree that yahoo is using OAuth 1.0, but please look at this link https://developer.yahoo.com/oauth2/guide/
The above link is related to OAuth 2.0 and that gives Access Token which is required in OAuth2Credential ( ), but still i couldn't get my result.

So please look at at it once and suggest me.

Thank you.
Coordinator
Nov 3, 2014 at 10:49 AM
Hi sauravAnand,

Yahoo currently supports OAuth2 only for Yahoo Gemini, no other services.

Greets,

Pavel
Nov 3, 2014 at 10:55 AM
Hey pavel,

Thank a lot for response.

So there is no way to achieve my requirements i guess,right??
But still if possible then suggest me what to do next for this.

Thank you.
Nov 5, 2014 at 5:12 AM
Hey pavel,

I want to know that will you help or guide me if i will ask other question than ImapX library. If yes then i have the issue of sending email in my application, actually as we discussed about Yahoo so that i have used OAuth 1.0 and got oauth_Token, oauth_Token_secret, oauth_session_handle and yahoo_guid.

https://developer.yahoo.com/mail/docs/user_guide/SendMessage.html

please have a look on the above link. This link is about SendMessage AND ComposeMessage of Yahoo mail web services. But i couldn't get the actual idea to how to implement it in my windows form application (c # ) using above tokens i have. I didn't get the idea of how to build SendMessage request and get response.

So if possible then please give me some point on that its really urgent.

Thank you.
Coordinator
Nov 5, 2014 at 10:36 PM
Hi sauravAnand,

Yahoo offers sample code in C#, which shows exactly how to use various mail APIs. Simply connect the Yahoo Web Service in your project (Yahoo! Mail WSDL) and take a look at the sample you can find here: https://developer.yahoo.com/mail/code/

Greets,

Pavel
Jan 5, 2015 at 7:43 AM
Hey pavel,

I have used your library for fetching emails and succeeded also, but now i want to implement features like mark as read and delete particular mail message or selected. I know how to perform mark as read and delete like : Message.Seen= true; But it will work while i am trying to fetch and mark as read functionalities both in a loop, i want to do this operation after i will display new mails to user in a list like(sender name,subject,date etc..) and then if user wants to do mark as read operation on a particular message then in this scenario how to identify that particular message on the on the Gmail server or any parameter i have to use for mark as read that message ?

If i have to use message unique Id or any for marking mails as read or delete then please suggest me how to perform this??

Thanks is advance.
Jan 20, 2015 at 5:59 AM
Hey pavel,

Welcome back. I want to know that how to open a specific email in the browser? Suppose i fetched all emails from gmail server and then whenever i click on any particular email message then it will go directly in browser and open that particular email if user already logged in. So is there any way to do this with the help of imapX library ?? Or any suggestions regards this by your side ??

Thanks in advance.
Jan 20, 2015 at 6:51 AM
Hey pavel,

When i am fetching emails from gmail server, i am getting GMailMessageId and GmailThread value is NULL. So can you please share the reason of this.

Thanks a lot.
Jan 20, 2015 at 10:44 AM
Hey pavel,

I solved the above problem for Gmail by using MessageFetchMode => GMailExtendedData, by this i got GmailThread id. But when i am doing the same for Hotmail again i am getting NULL value.

var client = new ImapClient("imap-mail.outlook.com", true);
                if (client.Connect())
                {
                    var credentials = new OAuth2Credentials(EmailAddress, AccessToken);
                    if (client.Login(credentials))
                    {                           
                        ImapX.Message[] messages = client.Folders.Inbox.Search(idOfMsg, ImapX.Enums.MessageFetchMode.GMailExtendedData);
                    }
                }
This worked for gmail, but not for Hotmail. Can you please help me out regarding this issue.??

Thanks a lot.
Coordinator
Jan 23, 2015 at 3:06 PM
Edited Jan 23, 2015 at 3:22 PM
Hi sauravAnand,

the name GMailExtendedData speaks for itself, this is a feature only avalable for GMail. Hotmail does not provide any extensions to return the thread ids for messages.

As for your question about opening the message in browser - you can save the body of the messages as html to disc and then open these files in browser.

Greets,

Pavel
Jan 27, 2015 at 6:52 AM
Hey pavel,

Thanks for your reply.