 |
|
 |
Hi,
I guess you wanted to code:
if ( !adress.IsGroupAddress ) {
adressesAll.Add((MailboxAddress) adress);
}
rather than:
if ( adress.IsGroupAddress ) {
adressesAll.Add((MailboxAddress) adress);
}
in public MailboxAddress[] Mailboxes get of Net/Mime/AddressList.cs.
Am I wrong???
Didier
|
|
|
|
 |
|
|
 |
|
 |
Hi I have strange first line in saved email from thunderbird:
From email@example.com Mon Nov 08 10:23:41 2010
It prevents from parsing the rest of the file. This line should be skipped and then the rest of the file should be parsed regulary.
my correction in file Mime/HeaderFieldCollection.cs in method public void Parse(Stream stream):
m_pHeaderFields.Clear();
StreamLineReader r = new StreamLineReader(stream);
241: string line = r.ReadLineString();
if (line.ToLowerInvariant().StartsWith("from ")) {
line = r.ReadLineString();
}
while(line != null){
if(line == ""){
break;
}
|
|
|
|
 |
|
 |
Hi,
First you need to use new version Mime class deprecated and replaced with Mail_Message:
http://www.lumisoft.ee/lsWWW/download/downloads/[^]
>From email@example.com Mon Nov 08 10:23:41 2010
Depends on what header filed this value is, but if in From or Date, then it's invalid value.
You should use try catch to access (From/Date) field, then you can can access raw header with msg.Header[xxx] ... .
But i suspect that this value is part of half Received: header, probably missing SPACE or TAB in front.
|
|
|
|
 |
|
 |
I've added support for linux line endigs, it could be useful (file: StreamLineReader.cs)
41: if((prevByte == (byte)'\r' && (byte)currByteInt == (byte)'\n')){
strmLineBuf.SetLength(strmLineBuf.Length - 2);
45: return strmLineBuf.ToArray();
}
else if ((byte)currByteInt == (byte)'\n')
{
strmLineBuf.SetLength(strmLineBuf.Length - 1);
return strmLineBuf.ToArray();
|
|
|
|
 |
|
 |
Hi,
In MIME line always must end with CRLF as per mime specification.
|
|
|
|
 |
|
 |
It doesn't matter, evolution mail client save email with linux line endings, and there is definetely more programs which don't respect RFC. Awareness of linux line endings won't make any harm.
|
|
|
|
 |
|
 |
When email is attachment in another email, the attached email isn't parsed and the property LumiSoft.Net.Mime.Mime.Attachments[0].data is null
my correction in file MimeEntity.cs (the changes are italic):
38: internal bool Parse(Stream stream,String toBoundary,bool attachment = false)
49: 50: if((this.ContentType & MediaType_enum.Multipart) != 0 && ! attachment){
81: 82: if(childEntity.Parse(stream,boundaryID,true) == false){
|
|
|
|
 |
|
|
 |
|
 |
Maybe I am missing something but here goes,
I have a mime disk file. I have gotten all of the data out of the file except for the attachment. How do I pull and save the attachment that is encoded in the mime file and save it to disk?
|
|
|
|
 |
|
|
 |
|
 |
Thanks. I also had to download the new version of the Lumisoft.Net dll from that same sight but now everything works great
|
|
|
|
 |
|
 |
Hi, It's me again. Since last question I have written a biggest program, and I have another problem. When I use your Net to send mails, it takes 100% of processor, computer works very slow. When sending is ended, than everything is as usual. This is a big problem for me becouse myprogram sends mostly huge messages with attachment only. Do you have any idea what should I do with it? Should it be in that way? Did you notice it?
|
|
|
|
 |
|
 |
Hi,
Thats not so simple to say ... it depends on your code and how many messages sent conccurently.
|
|
|
|
 |
|
 |
I send only one message concurrently.
Maybe I should not use SMTP_Client.QuickSendSmartHost(...). I seams to be created for fast, small messages. What do you think? Here is the code I use, it's simple:
string To = "to@host.pl";
string Subject = "My thema";
string Patch = @"Path to my file";
string Host = "mail.host.pl";
int Port = 587;
string User = "user";
string Password = "pass";
string Address = "user@host.pl";
Mail_Message message = createMessageAttOnly(To, Subject, Patch);
IO.MemoryStream msgStr = new IO.MemoryStream();
message.ToStream(msgStr, null, null);
msgStr.Seek(0, IO.SeekOrigin.Begin);
SMTP_Client.QuickSendSmartHost(null, Host, Port, false, User, Password, Address,
new string[] { To }, msgStr);
I use your method to create message att only so i don't paste it here...
I'm sory I ask you so many questions, but I'm about ending my program when I deal with that problem. Really thank you for help.
|
|
|
|
 |
|
 |
How big is message in bytes ?
>SMTP_Client.QuickSendSmartHost
Does this method raises CPU usage ?
How long is CPU usage up ?
|
|
|
|
 |
|
 |
This time stream Length = 1264722 in bytes. But it doesn't metter. Small, big, it's allways the same. Sometimes(when att is empty or very small) it just doesnt have enough time to achieve 100% becouse sending ends.
Yes, this method raises CPU usage.
All the time when method is working.
|
|
|
|
 |
|
 |
It depends on execution time, if it's just a little time it's ok.
You can measure time.
DateTime start = DateTime.Now;
// Code
Console.WriteLine("-----------" + (DateTime.Now - start).TotalMilliseconds + "----------------");
Or message box instead console on widows forms.
|
|
|
|
 |
|
 |
Execution time of QuickSendSmartHost? When sending file I mentioned above, one with Length = 1264722 it took 12250 miliseconds, and all the time CPU usage was almost 100%. Of course when I send bigger file(like 10,20,50MB) it takes proportionaly more time. What now? Is that right?
|
|
|
|
 |
|
 |
>1264722 it took 12250
That may be ok.
But i can say if 10mb message takes full CPU for 10 seconds, thats not ok.
For big messages exec time may be depend on network upload speed, but then CPU utlization must not be high.
|
|
|
|
 |
|
 |
Yes, that's right. So I undearstand the code I have written above works fine on your computer? Speed depends on internet speed and it doesn't take 100% of CPU usage? I have tried it on 2 computers. It's allways the same. Even if I dont use it in my program(which could probably be the reason of high CPU usage), but in new, totally clear project, just one button, and code above.
|
|
|
|
 |
|
 |
I dont exactly get waht yuo mean ...
But ...
Give me message you try (for example ca 3 MB) give your result exec time and CPU usage of sending time.
I will try in my computer and see the result and let you know result.
Example message please zip and email to ivar@lumisoft.ee .
Oh also don't dink too lot today ... try not yo sleep this yea down
|
|
|
|
 |
|
 |
When loading a .msg file with Mail_Message.ParseFromFile, the BCC addresses aren't returned.
Am I missing something?
|
|
|
|
 |
|
 |
Hi,
I just tried with my message, Bcc parsed ok.
1) There can be 2 things, you old version.
2) There is something wrong with message.
|
|
|
|
 |
|
 |
1. I'm using the latest version that can be downloaded off of your site. Do I need to download and build from SVN?
2. Here's the content of the .msg file
X-Sender: from@test.com
X-Receiver: to_njbrad007@optonline.net
X-Receiver: cc_njbrad007@optonline.net
X-Receiver: bcc_njbrad007@optonline.net
X-Receiver: bcc2_njbrad007@optonline.net
X-Receiver: bcc3_njbrad007@optonline.net
MIME-Version: 1.0
From: from@test.com
To: to_njbrad007@optonline.net
Cc: cc_njbrad007@optonline.net
Date: 17 Dec 2010 19:41:27 -0500
Subject: Subject
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Body
EDIT
LumiSoft.Net.Mime.Mime.Parse finds the BCC fine, but Mail_Message.ParseFromFile() does not.
LumiSoft.Net.Mime.Mime is marked as deprecated, so I'm wary of putting it into new code.
Thanks for looking
modified on Saturday, December 18, 2010 2:33 PM
|
|
|
|
 |