- Added support for the STATUS command
↧
Source code checked in, #34471
↧
New Post: Create a message after being Sent
I am using System.Net.Mail to send mail using an imap server.
The mail server does not create a copy of the mail to a "Sent folder".
How I can create a message in a certain folder? (In this case in the Sent folder)
Thanks!
The mail server does not create a copy of the mail to a "Sent folder".
How I can create a message in a certain folder? (In this case in the Sent folder)
Thanks!
↧
↧
New Post: Create a message after being Sent
Hi gvaldesmcl,
to save a System.Net.MailMessage to the sent folder you can use the following code:
Best regards,
Pavel
to save a System.Net.MailMessage to the sent folder you can use the following code:
// Create and send a message using System.Net.Mail
var mailMessage = new System.Net.Mail.MailMessage();
// ... send logic here ..
// Creating an ImapClient
var client = new ImapClient("imap.gmail.com", true);
// Connecting
if(client.Connect())
{
// Authenticating
if(client.Login("name@gmail.com", "password"))
{
// Saving the System.Net.Mail.MailMessage directly to Sent folder:
client.Folders.Sent.AppendMessage(mailMessage);
}
}
Hope this helps,Best regards,
Pavel
↧
New Post: Create a message after being Sent
Thanks for the Reply!
The code seems to compile and run with no problems, but for some reason its not working.
The statement "client.Folders.Sent.AppendMessage(mailMessage);" returns FALSE (does it mean is not appending the email?)
My imap folder structure (I'm not using gmail, no ssl and authentication required) are like: INBOX.Drafts, INBOX.Sent, INBOX,Trash, etc.
So I tried in many ways:
client.Folders.Inbox.SubFolders["Sent"].AppendMessage(msgeme)
client.Folders.Sent.AppendMessage(msgeme)
client.Folders["INBOX"].SubFolders["Sent"].AppendMessage(msgeme)
But all return False.
Another thing that I observe while debugging is that the client.UserLogin and client.UserPassword throws a "System.NotSupportedException"
Any ideas??
Thanks!
The code seems to compile and run with no problems, but for some reason its not working.
The statement "client.Folders.Sent.AppendMessage(mailMessage);" returns FALSE (does it mean is not appending the email?)
My imap folder structure (I'm not using gmail, no ssl and authentication required) are like: INBOX.Drafts, INBOX.Sent, INBOX,Trash, etc.
So I tried in many ways:
client.Folders.Inbox.SubFolders["Sent"].AppendMessage(msgeme)
client.Folders.Sent.AppendMessage(msgeme)
client.Folders["INBOX"].SubFolders["Sent"].AppendMessage(msgeme)
But all return False.
Another thing that I observe while debugging is that the client.UserLogin and client.UserPassword throws a "System.NotSupportedException"
Any ideas??
Thanks!
↧
New Post: Cannot Login in an ASP.NET hosted in different server
Hi there guys!
I hope you guys can help me with this problem, i Dont have problems with my ASP.NET application if it is hosted in my PC, but when the application is moved to another Hosting Server ( i rented one and i think its in california) I CAN CONNECT TO GMAIL BUT I CANT LOGIN I ALWAYS GET AN ERROR
I would like to know if i can get a solution with this.
Thank you ^_^
I hope you guys can help me with this problem, i Dont have problems with my ASP.NET application if it is hosted in my PC, but when the application is moved to another Hosting Server ( i rented one and i think its in california) I CAN CONNECT TO GMAIL BUT I CANT LOGIN I ALWAYS GET AN ERROR
I would like to know if i can get a solution with this.
Thank you ^_^
↧
↧
New Post: Create a message after being Sent
Hi gvaldesmcl,
you don't need to lookup the folder by its name unless it not has been recognized automatically. Simply access it through client.Folders.Sent if it's not null. I will give it a try today, actually appending the message should work without any problems.
As for your question about client.UserLogin and client.UserPassword, these two properties are obsolete and relaced by client.Credentials.
Greets,
Pavel
you don't need to lookup the folder by its name unless it not has been recognized automatically. Simply access it through client.Folders.Sent if it's not null. I will give it a try today, actually appending the message should work without any problems.
As for your question about client.UserLogin and client.UserPassword, these two properties are obsolete and relaced by client.Credentials.
Greets,
Pavel
↧
New Post: Cannot Login in an ASP.NET hosted in different server
Hi rodolfolopes,
can you provide more details? What do you mean by you always get an error? is an exception thrown? Or the ImapClient.Login method just returning false?
Greets,
Pavel
can you provide more details? What do you mean by you always get an error? is an exception thrown? Or the ImapClient.Login method just returning false?
Greets,
Pavel
↧
New Post: Problem connecting using mono
A belated thanks for the tips. The code I was developing had to go into production for the tech search party last Saturday night in Noe Valley and given the time constraints I ran it off a windows laptop but I had some time to go back and test this weekend and indeed, either disabling certificate checking as suggested, or following the mono-project FAQ and running mozroots --import in the linux account running the client resolved the issues. That's a nice trap for the unwary but the key phrase in the FAQ which stands out is "Note that a default installation of Mono doesn't trust anyone!" which makes running an SSL connection tough. The mono error message might have been a little more friendly but lesson learned.
Pavel, I processed a few hundred documents with image attachments for that event and found a few that broke ImapX. Will send details in a separate email, but it mostly performed admirably
Pavel, I processed a few hundred documents with image attachments for that event and found a few that broke ImapX. Will send details in a separate email, but it mostly performed admirably
↧
New Post: Cannot Login in an ASP.NET hosted in different server
Hi there
Thanks for the reply...
Yeah the connection is true
and the LogIn is FALSE
I dont if theres a mehot to make the LogIn true anywhere around the world
Thanks for the reply...
Yeah the connection is true
and the LogIn is FALSE
I dont if theres a mehot to make the LogIn true anywhere around the world
↧
↧
New Post: Image attachment breaks parser
Hi Pavel,
as I mentioned in previous message, I was processing a lot of image attachments for software for processing puzzle hunt email and one user's images were consistently triggering this problem when iterating over attachments. If it's not obvious what the problem is, I can try to fish out the offending email and send it to you. It downloads ok, and I can get all the email metadata but once I start processing the image attachments, I get this traceback. I'm pretty sure the email was legit because other clients (e.g. gmail) could view the email perfectly,
Darren
p.s. the download raw method worked beautifully.
The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64CharArray(Char[] inArray, Int32 offset, Int32 length)
at System.Security.Cryptography.FromBase64Transform.TransformBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[] outputBuffer, Int32 outputOffset)
at ImapX.EncodingHelpers.Base64.FromBase64(String s) in c:\proj\DotNet\imapx-34274\ImapX\EncodingHelpers\Base64.cs:line 105
at ImapX.Attachment.get_FileData() in c:\proj\DotNet\imapx-34274\ImapX\Attachment.cs:line 47
at Download.imapMain(String connString, Int32 N) in C:\proj\TSP\tspdownload\download.fs:line 257
as I mentioned in previous message, I was processing a lot of image attachments for software for processing puzzle hunt email and one user's images were consistently triggering this problem when iterating over attachments. If it's not obvious what the problem is, I can try to fish out the offending email and send it to you. It downloads ok, and I can get all the email metadata but once I start processing the image attachments, I get this traceback. I'm pretty sure the email was legit because other clients (e.g. gmail) could view the email perfectly,
Darren
p.s. the download raw method worked beautifully.
The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)
at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
at System.Convert.FromBase64CharArray(Char[] inArray, Int32 offset, Int32 length)
at System.Security.Cryptography.FromBase64Transform.TransformBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[] outputBuffer, Int32 outputOffset)
at ImapX.EncodingHelpers.Base64.FromBase64(String s) in c:\proj\DotNet\imapx-34274\ImapX\EncodingHelpers\Base64.cs:line 105
at ImapX.Attachment.get_FileData() in c:\proj\DotNet\imapx-34274\ImapX\Attachment.cs:line 47
at Download.imapMain(String connString, Int32 N) in C:\proj\TSP\tspdownload\download.fs:line 257
↧
New Post: Cannot Login in an ASP.NET hosted in different server
Hi,
for security reasons GMail often blocks the login from a new unusual place. Can you try sign in Gmail through the browser on your server? I think all you need is unblocking the account to trust the new location.
best regards,
Pavel
for security reasons GMail often blocks the login from a new unusual place. Can you try sign in Gmail through the browser on your server? I think all you need is unblocking the account to trust the new location.
best regards,
Pavel
↧
New Post: Image attachment breaks parser
I dug into this a bit more and I have an example document that breaks ImapX if you'd like a copy. Taking a look at the exception
![Image]()
I suspect the problem is the leading space character in this buffer,
Darren

I suspect the problem is the leading space character in this buffer,
Darren
inputBytes
inputBytes
{byte[34]}
[0]: 32
[1]: 66
[2]: 79
[3]: 68
[4]: 89
[5]: 91
[6]: 49
[7]: 46
[8]: 50
[9]: 93
[10]: 32
[11]: 78
[12]: 73
[13]: 76
[14]: 32
[15]: 66
[16]: 79
[17]: 68
[18]: 89
[19]: 91
[20]: 49
[21]: 46
[22]: 50
[23]: 46
[24]: 77
[25]: 73
[26]: 77
[27]: 69
[28]: 93
[29]: 32
[30]: 78
[31]: 73
[32]: 76
[33]: 41
↧
New Post: Image attachment breaks parser
One final piece of the puzzle, that line doesn't seem to be base64 image encoding, it's actually the text
Darren
BODY[1.2]NILBODY[1.2.MIME]NIL)
which doesn't appear in the actual email, - looks like an IMAP instruction that's getting into the image parsing.Darren
↧
↧
New Post: Save EML
I am having trouble saving an email in EML format.
Could post an example here to do this?
Could post an example here to do this?
↧
New Post: Date difference in received time and date of message from imapx
I am using the same code from your Vb.Net code repository to get the messages in inbox like
sFolder = iClient.Folders.Inbox
For Each m In _messages
Next
While accessing m.date it is returing some date not exactly displyed in inbox
why ??
sFolder = iClient.Folders.Inbox
_messages = Enumerable.ToList(Of Message)(Enumerable.OrderByDescending(Of Message, Nullable(Of DateTime))(sFolder.Search("ALL", -1, -1), Function(m As Message)
Return m.Date
End Function))
and I am iterating with _messages using For Each m In _messages
Next
While accessing m.date it is returing some date not exactly displyed in inbox
why ??
↧
New Post: Save EML
Hi bresolin,
to get the message as EML, you can use the Message.ToEml method, as well as the Message.DownloadRawMessage (available in latest repository code). At the moment I'd recommend the second, as it's working best.
Greets,
Pavel
to get the message as EML, you can use the Message.ToEml method, as well as the Message.DownloadRawMessage (available in latest repository code). At the moment I'd recommend the second, as it's working best.
Greets,
Pavel
↧
New Post: Date difference in received time and date of message from imapx
Hi sureshbarathan,
I think the problem lies in the time zones. They will be dropped parsing the date, which causes the time difference. I'll make an update to fix this.
Best regards,
Pavel
I think the problem lies in the time zones. They will be dropped parsing the date, which causes the time difference. I'll make an update to fix this.
Best regards,
Pavel
↧
↧
New Post: Image attachment breaks parser
Hi Darren,
thank you for the great research work! The main problem here is that ImapX doesn't read literal strings taking in account their size which is provided by the server. This is the reason why sometimes the content part body contains additional characters which causes the decoder to fail with an exception.
I'm working on an update, hope to release it soon.
Greets,
Pavel
thank you for the great research work! The main problem here is that ImapX doesn't read literal strings taking in account their size which is provided by the server. This is the reason why sometimes the content part body contains additional characters which causes the decoder to fail with an exception.
I'm working on an update, hope to release it soon.
Greets,
Pavel
↧
New Post: Save EML
Hi,
ToEml the method is also giving error "Object reference not set to an instance of an object."
I am listing the emails to the method Folders.Inbox.Search("UNSEEN").OrderByDescending(m => m.Date).ToList()
This same error occurs when using the methods message.Save ou SaveTo
ToEml the method is also giving error "Object reference not set to an instance of an object."
I am listing the emails to the method Folders.Inbox.Search("UNSEEN").OrderByDescending(m => m.Date).ToList()
This same error occurs when using the methods message.Save ou SaveTo
↧
New Post: Unable to get body
HI Pavel,
I was taken with many other jobs and only today I could try the new code but I get the same problem.
I wait for the next update!!
thanks
I was taken with many other jobs and only today I could try the new code but I get the same problem.
I wait for the next update!!
thanks
↧