Hi,
I wanted to list all the messages from "Sent Mail" folder of gmail using ImapClient. But it always gives me error that folder doen't exist.
Plz help ??
Hi,
I wanted to list all the messages from "Sent Mail" folder of gmail using ImapClient. But it always gives me error that folder doen't exist.
Plz help ??
Hi Majid,
Babar,
Thanks for your response.
I have already figured that out and solved the issue.
But I have run into other couple of issues, will you please help me out.
1. I want to create an entry in the sent items folder explicitly. Very similar to that of drafts folder. Is that possible ? If yes can u please send me any code sample ?
Majid,
Software Engineer,
Masterkey Systems.
majidkorai:1. I want to create an entry in the sent items folder explicitly. Very similar to that of drafts folder. Is that possible ? If yes can u please send me any code sample ?
by entry i meant a message.
I want to create a message entry in sent mail folder. is it possible ?
I am able to do so while working with exchange API. Now i want to do the same here with gmail api too.
Majid
Hi Majid,
Thank you for the clarification.
Using ImapClient, you can append a message to any folder/sub-folder of your Gmail account. Please check the below source code for your reference,
C#
var client = new Aspose.Email.Imap.ImapClient(“[imap.gmail.com](http://imap.gmail.com/)”, "username@gmail.com", “password”);
client.Connect(true);
var message = new MailMessage();
message.From = "from@domain.com";
message.Subject = “Subject”;
message.Body = “body”;
client.AppendMessage("[Gmail]/Sent Mail", message);
Thanks babar.
It worked.
Hi,
Another issue…
I want to search the messages from server on the basis of a date.
MailQuery provides me with search on dates.
But still there is an issue with it. It only searches between dates and not time.
With a little research i found that IMAP supports the search between dates and times. It provides two operators “YOUNGER” and “OLDER” for this.
Now my question is this, that can i provide this sort of command in string format to MailQuery ? or is there any other way i can search the messages on the basis of date and time.
Hi Majid,
Hi Majid,
Thank you for your patience.
It is to brief you on the current status of the ticket NETWORKNET-33240, that we have closed after analyzing the issue in detail.
Please note that Aspose.Email’s MailQuery class uses ‘Search’ command of Internet Message Access Protocol (IMAP). According to [RFC3501](http://tools.ietf.org/html/rfc3501#section-6.4.4)
the type date uses only date value disregarding time and timezone. So we can’t filter messages by time with IMAP ‘Search’ command, but in some cases it is possible to filter the search results after IMAP ‘Search’ command has finished.
If you require I can pass on a workaround for your situation.
Regards,