 |
|
 |
Hello! as subject: Could you please write a simple sample code that reads a eml file and load it on a MailMessage class of .net framework?
thank you.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Following message store as a 1.email and trying to parse.
But intialization get error INVALID-FIELD MESSAGE-ID, This emails comes from X-user clients
so failed to parse for display on website have any solution. I think problem because space before Message id how can I handle it.
================ Copy from above content in a file ===================== Message-ID: <200906121804578_11> From: mmtclimited@hometown.net To: mmtclimited@hometown.net Subject: RENOVATION OF SHOP AT BHAWAN Date: Fri, 12 Jun 2009 10:18:04 Mime-Version: 1.0 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
<HTML> <HEAD></HEAD> <BODY><A href="http://www.mmtclimited.com/tender/tender_details.php?id_pk=1524">http://www.mmtclimited.com/tender/tender_details.php?id_pk=1524</A></BODY> </HTML> =================Copy End =====================
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi Ivar,
I tried to re-compile your latest code downloaded from http://www.lumisoft.ee/lswww/download/downloads/Net/[^] and used the output dll into my project.
But, compiling my project with the new compiled DLL it gives this error:
------- 'LumiSoft.Net.Mail.Mail_Message' does not contain a definition for 'Attachments' and no extension method 'Attachments' accepting a first argument of type . -------
It look like, your latest code doesn't is not as latest as your dll found in some of the sample. So, I cannot use the 'Atachments' method.
Could you upload the latest code, so that I could try to solve the attachment problem?
Thanks.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Thanks. I really appreciate that.
But my current "TortoiseSVN" client program seems not the latest as there is no way i can put in the login name and password. So, I cannot download it. Could you just email me your latest Mail_Message.cs
I'm sorry for this trouble. At the mean I'm upgrading my TortoiseSVN client.
rgds, sarif
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi Ivar,
I tested it two ways:
a) convert to byte array --> parse from byte array --> read the attachment b) save it as a file --> parse from file --> read the attachment.
In both cases, the exception is thrown at the code line below:
MIME_Entity entity = mime.Attachments[0];
The way we attach the file (as shown in "..\MailMessageExamples\Program.cs") like below:
multipartMixed.BodyParts.Add(Mail_Message.CreateAttachment("attachment.txt"));
Or is this bugs?
rgds, sarif
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi Ivar,
Thanks for the reply of my earlier question. And yes, I can now convert to byte array of my Mail_Message object. Thank you.
My next problem is it cannot parse the 'attachment' object. The error is like below: ---------------------- System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> LumiSoft.Net.ParseException: Header field 'ContentDisposition' parsing failed. at LumiSoft.Net.MIME.MIME_Entity.get_ContentDisposition() ----------------------
I'm following your sample on how to add attachment, like below:
//--- application/octet-stream ----------------------------------------------- multipartMixed.BodyParts.Add(Mail_Message.CreateAttachment("pic.jpg"));
The only different is, your sample is attaching txt file while mine is jpg file. Should I use different method, then?
thanks again.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi Ivar,
Thanks for the demo list link. I still have question about MIME to byte array problem:
In the old code: I can do like below:
--------- Mime m = new Mime(); MimeEntity mainEntity = m.MainEntity; ... byte[] byteStream = m.ToByteData(); ---------
In the new code; we should use "Mail_Message" instead
---------- Mail_Message msg = new Mail_Message(); msg.MimeVersion = "1.0"; ... ------------
So, how to convert this "msg" to byte array?
I need this mime message to be converted as byte array before I can send it my proxy.
rgds, sarif
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi Ivar,
I downloaded your latest code from here: http://www.lumisoft.ee/lswww/download/downloads/Net/[^]
I even downloaded your help page from there, but I get confused of how to use this new code. The sample given is meant for the old code, and the help doc is really too technical that i don't know how to start.
Could you provide the new help related with new code which have step by step of how to use the class by case (start from basic to advance)?
My specific problem is how to convert the Mime object data to bytes array.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Can you give us an update on the status of the new development?
Does the code that's included here have all of the latest bug fixes or should we be using the code on your website even though the old methods are marked as [depreciated]?
Thanks!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
I have been looking for a free mime parser for a long time, this is the first that really works with swedish letters (åäö)! Thank you!
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
 |
Hi,
On your project at http://www.lumisoft.ee/lsWWW/Download/Downloads/Net, the code I'm using (and the version that your help refers to) now seems to be in the "old" folder. I tried to use the "new" classes but couldn't find my way into them (eg having parsed a message I couldn't even work out how to access its body text), so I am continuing to use the "old" Mime.Parse() etc.
It's confusing because these "old" files now refer to some new files, and there is some duplication (eg MimeUtils.cs and Old\Mime_Utils.cs). Please could you clarify which versions of which files you would like us to use, eg should we discard old/Mime_Utils.cs?
Many thanks again for an enormously useful project.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hello, Thanks for the excellent project. I'm trying to save a mail out to EML format, but the time is getting corrupted. DateTimeToRFC2822 converts the time form local time to UTC, but this is all wrong: the message's time is in the sender's time zone, not mine, and anyway mail clients seem to assume it's in local time not UTC. Why is it converting to universal time? Thanks
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
The method is UTC because most places should preserve UTC time not local, and display app should use DateTime.ToLocal. I can add paramter bool utc, then you can control time what is returned.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Thanks for the excellent library which saved lots of time. However, there is a minor thing in the function <code>ParseRfc2822DateTime </code>in MIME_Utils.cs. I found all the email processed producing a wrong date and found the typo there (which only occurs in OCTOBER!)
<pre>... else if(v == "jun"){ month = 6; } else if(v == "jul"){ month = 7; } else if(v == "aug"){ month = 8; } else if(v == "sep"){ month = 9; } else if(v == "oct"){ month = 9; <-------- should be 10 } else if(v == "nov"){ month = 11; } ...</pre>
Note: This version was downloaded on 17Oct2008. Despite, the library is still marvelous.
Keep up the good work.
--pc
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
Thanks reporting it, i fixed it this at the beginning of this month.
Soon i will release fix: after i put code up to SVN server(google or sourceforge) (Will accept some contributing volunteers)
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |