 |
|
 |
Hi Thanks for this component.
Great work..
There is some problem to save attachment from eml; when there is an .eml file itself as attachment in an eml file.
|
|
|
|
 |
|
 |
Ehe "There is some problem", it sound like huston we have problem, what it the problem ?
|
|
|
|
 |
|
 |
Sorry for not providing detail.
Problem was when there was attachment type of eml.
it was returning no byte array from that attachment.
And also it was not taking some other files in that attachment.
But As I said the latest version is working fine.
Any way Good work. It's one among the top post I found in Code project.
|
|
|
|
 |
|
 |
I used the latest version it's working with eml within eml.
Thanks..
|
|
|
|
 |
|
 |
Hi Ivar!
I have a little problem...I was trying to parse an incoming POP3 e-mail:
POP3_ClientMessage PopMessage = Pop.Messages [i];
Mail_Message MailMessage = Mail_Message.ParseFromByte (PopMessage.MessageToByte ());
My problem is that the mail server used doesn't comply to RFC 2822 to format date-time field, it is "Date: 30 Sep 2009 17:46:22" instead of "Date: 30 Sep 2009 17:46:22 +0200", so your parser throws a ParseException...is there a way to avoid parsing of the time zone field? Without recompiling your library and without making a workaround modifying the "Date: " field and adding the field...
By the way, you made a great work with this library, it is very useful!!!
|
|
|
|
 |
|
 |
Hi,
I tested, it is parsed, are you shoure that you latest version.
Pop3 example app may have older net.dll ... .
|
|
|
|
 |
|
 |
I downloaded the DLL from this URL:
http://www.lumisoft.ee/lswww/download/downloads/Net/LumiSoft.Net.zip
so I think this is the latest version.
My problem is that your library parses the "+0200" field (according to RFC 2822), but my mail server doesn't send it, so the date field is incomplete and when I try to parse the message, a ParseException is thrown on the Date field.
Is there a way to set a "no RFC 2822 compliance" flag, so when parsing date the "+0200" field is ignored?
I know this is and odd request, but I wouldn't like to rebuild your library (it works perfectly as is), so if there is another solution, it is welcome!
Thanks again
EDIT:
I think parsing fails here (MIME_Utils.cs):
// We have optional "second".
if(r.Peek(true) == ':'){
r.Char(true);
second = Convert.ToInt32(r.Atom());
}
int timeZoneMinutes = 0;
v = r.Atom(); <<<<<<<<< HERE
// We have RFC 2822 date. For example: +2000.
if(v[0] == '+' || v[0] == '-'){
...
Atom function returns null because after seconds there is "\r\n" instead of "+0200" (or RFC 822 GMT field), so the "v[0] ==" instruction throws a null pointer exception.
modified on Friday, October 2, 2009 5:29 AM
|
|
|
|
 |
|
 |
The new version will be up at next week, i have some IMAP related pending stuff - so can't put current as live.
If you need it faster - i can only email newer binary.
|
|
|
|
 |
|
 |
No thanks, no need to mail me new binaries. I'll wait for the new release! Thanks a lot!!
|
|
|
|
 |
|
 |
hi ivar and thanks for this great library.
i looked around but could not find a parsing a mime file examples with the new library.
providing some parsing examples will be apreciated.
thank you very much.
- ilker
|
|
|
|
 |
|
|
 |
|
 |
I had a friend contact me with some MIME email logs he needed parsed and converted to CSV and this worked great so thanks! The only change I made was to change HeaderFieldCollection -> IEnumerable<HeaderField> so I could use LINQ to query the data like this:
var ip = from x in m.MainEntity.Header
where x.Name.Equals("X-Originating-IP:")
select x;
|
|
|
|
 |
|
|
 |
|
 |
Im working in an application that cames from an Outlook.MailItem, I receive an email with a eml file attached, and inside that, another eml attached with documents inside. I Tryed to do it recurivelly using the MIME.Parser and Attachmments, but when reading an attachment of type "eml", it seems not all the information is on it.
Any Idea?
Regards, broxcj
|
|
|
|
 |
|
 |
Latest parses message/rfc822 out of box. In older version yep you needed to call MIME.Parser .
|
|
|
|
 |
|
 |
Thanks, I found there was another question about this, I updated the code, and worked for me .
|
|
|
|
 |
|
 |
I have a need to change an email that only has an attachment to one that has an attachment and a plain text body. I have successfully modified the BodyText to allow me to set a value, but it requires it to already have an entity there for it to set.
How would I go about changing a singlepart to multipart and still preserve the attachment? It is requiring me to clear the Data before changing to MultiPart:
MainEntity.Data = null;
MainEntity.ContentType = MediaType_enum.Multipart;
|
|
|
|
 |
|
 |
First of all single part message can't have attachment and body text. It can be text message or attachment message.
SO your message alreay is multipart message.
|
|
|
|
 |
|
 |
It starts off as a singlepart attachment message, but I need to create a body on the fly.
I think I have something here, I just don't know if I'd screw some other type of message up:
private void CheckMultiPartAndSwitch()
{
if (MainEntity.ContentType != MediaType_enum.Multipart && MainEntity.ContentDisposition == ContentDisposition_enum.Attachment)
{
string _sFileName = MainEntity.ContentDisposition_FileName;
MediaType_enum _ct = MainEntity.ContentType;
ContentTransferEncoding_enum _enc = MainEntity.ContentTransferEncoding;
byte[] _data = MainEntity.DataEncoded;
MainEntity.Data = null;
MainEntity.ContentType = MediaType_enum.Multipart_alternative;
MainEntity.ContentDisposition = ContentDisposition_enum.NotSpecified;
MainEntity.ContentDescription = "";
MimeEntity _attachEntity = MainEntity.ChildEntities.Add();
_attachEntity.ContentDisposition = ContentDisposition_enum.Attachment;
_attachEntity.ContentDisposition_FileName = _sFileName;
_attachEntity.ContentType = _ct;
_attachEntity.ContentTransferEncoding = _enc;
_attachEntity.DataEncoded = _data;
}
}
I have added a set to this:
Mime.cs
public string BodyText
{
get
{
MimeEntity[] entities = this.MimeEntities;
foreach (MimeEntity entity in entities)
{
if (entity.ContentType == MediaType_enum.Text_plain)
{
return entity.DataText;
}
}
return null;
}
set
{
MimeEntity[] entities = this.MimeEntities;
foreach (MimeEntity entity in entities)
{
if (entity.ContentType == MediaType_enum.Text_plain)
{
entity.DataText = value;
return;
}
}
CheckMultiPartAndSwitch();
MimeEntity textEntity = MainEntity.ChildEntities.Add();
textEntity.ContentType = MediaType_enum.Text_plain;
textEntity.ContentTransferEncoding = ContentTransferEncoding_enum.QuotedPrintable;
textEntity.DataText = value;
}
}
|
|
|
|
 |
|
|
 |
|
 |
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.
|
|
|
|
 |
|
|
 |
|
 |
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 =====================
|
|
|
|
 |
|
 |
Dont know, i can cparse that message ok.
Though message id is suggetsted to have "@" in like: part1@part@
|
|
|
|
 |
|
 |
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.
|
|
|
|
 |