Search The ForumSearch   RegisterRegister  LoginLogin

MailBee Objects

 AfterLogic Forum : MailBee Objects
Subject Topic: EncodeHeaderText in multiple TO address Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 04 April 2008 at 7:02am | IP Logged Quote iconbill

I'm trying to use EncodeHeaderText in the TO-address when sending a message. But I only see code examples for use with 1 name and 1 emailaddress .

Is it possible to let the component handle multiple addresses?

ToAdds = """Recipient1"" <test1@domain.com>, ""Recipient2"" <test2@domain.com>, test3@domain.com"

Because this is not working :

objSMTP.Message.EncodeHeaderText("To", ToAdds, "utf-8", 3)

How can I use this function to handle multiple recipients? Because it would be strange if I have to call EncodeHeaderText for every recipient over and over.


Thank you!
Back to Top View iconbill's Profile Search for other posts by iconbill
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 04 April 2008 at 11:15am | IP Logged Quote Andrew

What do you mean of "this is not working"? Which e-mail client do you use to check this?

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 05 April 2008 at 5:10am | IP Logged Quote iconbill

In the case we used multiple address in EncodeHeaderText , then Outlook showed only one address (of course wrong).

My example code with 'EncodeHeaderText':

--- ONE RECIPIENT TEST --
IN: "Recipient1" <test1@domain.com>

OUT: =?utf-8?B?IlJlY2lwaWVudDEiIA==?=<test1@domain.com>

REMARK: This looks correct

--- MULTIPLE RECIPIENTS TEST --
IN: "Recipient1" <test1@domain.com>, "Recipient2" <test2@domain.com>

OUT: =?utf-8?B?IlJlY2lwaWVudDEiIA==?=<test1@domain.com>=?ut f-8?B?LCAiUmVjaXBp?=
     =?utf-8?B?ZW50MiIg?=<test2@ domain.com>

REMARK: This doesn't look correct , where is the separator? Is it also encoded? And why is there a vbCrlf added?

Kind regards,

Marco   
Back to Top View iconbill's Profile Search for other posts by iconbill
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 07 April 2008 at 7:13am | IP Logged Quote Andrew

Yes, there was indeed a problem with encoding commas. Please try the updated version of MailBee.dll. Please let us know if this helps.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 07 April 2008 at 11:52pm | IP Logged Quote iconbill

It works better as before yes, but there is still a problem.

Example code with 'EncodeHeaderText' in the T0-address:

Input: "Recipient1" <test1@domain.com>, "Recipient2" <test2@domain.com>
Message send:
Displayed correctly:

Input: <test1@domain.com>, <test2@domain.com>
Message send:
Displayed correctly:

Input: test1@domain.com, test2@domain.com
Message send:

Back to Top View iconbill's Profile Search for other posts by iconbill
 
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 08 April 2008 at 12:06am | IP Logged Quote iconbill

Something else. In the forum preferences:

'Present server date and time is: 30 December 1899 at 12:00am'

I know we have some time diference, but years?
Back to Top View iconbill's Profile Search for other posts by iconbill
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 08 April 2008 at 3:17am | IP Logged Quote Andrew

Quote:
Input: test1@domain.com, test2@domain.com
Message send:


Yes, there is indeed a problem. We'll investigate this.

Quote:
Something else. In the forum preferences:

'Present server date and time is: 30 December 1899 at 12:00am'

I know we have some time difference, but years?


This is some kind of static information defined in the source code of the forum. We use a third-party free forum engine. Please never mind this text

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 08 April 2008 at 10:35am | IP Logged Quote Alex

Please try the updated version of MailBee.dll.

Best regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 09 April 2008 at 12:27am | IP Logged Quote iconbill

Hi Alex,

this version is not working here. When we sent a message the CPU gets 100% for maybe 4 minutes.

Even without using 'EncodeHeaderText' the SMTP Clas is using 100% CPU

When I go back to version 5.5.0.122 I can send messages again!

So at this moment I can not even test the problem concerning multiple recipient with 'EncodeHeaderText'

Back to Top View iconbill's Profile Search for other posts by iconbill
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 09 April 2008 at 6:47am | IP Logged Quote Andrew

Thank you for the test samples you provided. They allowed us to resolve another small issue. However, that issue cannot cause using 100% CPU.

To investigate what exactly causes using 100% CPU, please install special debug version of MailBee.dll

This debug version of MailBee.dll creates special debug log located at:

C:\mailbee_debug.txt

The location cannot be changed, so please make sure the system account your application is running under has permission to write into the specified location.

Reproduce the issue and provide us with that special debug log for examination.

The "normal" version of the updated MailBee.dll is available here.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 09 April 2008 at 7:48am | IP Logged Quote iconbill

Andrew, is the debug file created at the moment the SMTP is called? Or is it created when he is done? or on error?

ps. When i'm sending a test message, the 'MailBee.SMTP.1' is running (component services) and dllhost.exe is using 100% cpu and there is no log-file created.
Back to Top View iconbill's Profile Search for other posts by iconbill
 
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 09 April 2008 at 7:56am | IP Logged Quote iconbill

We fixed a security problem so I see a logfile now!

MailBee.SMTP.1 is running at this moment. I have to wait maybe 10 minutes, till the timeout has reached.

This is the current last line from the debug file : 'TestLicenseKey 9ok' (he is still running)

I post tomorrow a new message if there is something added to this last debug line.

Back to Top View iconbill's Profile Search for other posts by iconbill
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 09 April 2008 at 8:52am | IP Logged Quote Alex

Could you also post the code you're using?

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 10 April 2008 at 12:57am | IP Logged Quote iconbill

Took me a while for find the problem, but I got a test scenario. In the case the recipientNAME has an '(' inside, then the CPU is going nuts.

== problem example ==
SMTP.Message.CodepageMode = 0
SMTP.Message.CodePage = 65001
SMTP.Message.CharSet = "UTF-8"

Message.EncodeHeaderText("From", "test(name <test@domain.com>","utf-8",3)

response.write "this will never be written"
=============

I test this same code SUCCESFULLY with:

"name <test@domain.com>"
"námé <test@domain.com>"
"greek Αναδίπλωση <test@domain.com>"
"name)) <test@domain.com>"

I hope the next version will never use 100% CPU anymore.
Back to Top View iconbill's Profile Search for other posts by iconbill
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 10 April 2008 at 5:34am | IP Logged Quote Andrew

Try the updated MailBee.dll.

Please let us know the outcome.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
tim
Newbie
Newbie


Joined: 01 June 2007
Location: Denmark
Online Status: Offline
Posts: 31
Posted: 10 April 2008 at 5:58am | IP Logged Quote tim

Andrew wrote:
Try the updated MailBee.dll.

Please let us know the outcome.

Best regards,
Andrew


When you get there, let me know. I now seem to have a periodically hanging dll as well.
Back to Top View tim's Profile Search for other posts by tim
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 10 April 2008 at 6:14am | IP Logged Quote Andrew

Quote:
When you get there, let me know. I now seem to have a periodically hanging dll as well.


Do you mean the latest version of the .dll we published today hangs too?

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 10 April 2008 at 7:18am | IP Logged Quote iconbill

My conclusion of version 5.5.0.125
- is stable again
- the bug with '(' in ] from name' is also fixed


I am very sorry, but I have still a bug:

this is working:

Message.EncodeHeaderText("From", ""11111111112222222222abcd" <test@domain.com>, test@domain.com","utf-8",3)



but if I put 1 extra char in the from name of the first recipient, then I get an error from smtp-server (500 5.5.1 / Command unrecognized / code 123 )

Example problem code:

Message.EncodeHeaderText("From", ""11111111112222222222abcdE" <test@domain.com>, test@domain.com","utf-8",3)

If i add manualy a <> arround the second recipient i can send again...

Back to Top View iconbill's Profile Search for other posts by iconbill
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 10 April 2008 at 8:10am | IP Logged Quote Alex

Try the updated MailBee.dll

Also, you should use Message.EncodeHeaderText("To", not "From") when encoding To field.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 11 April 2008 at 12:16am | IP Logged Quote iconbill

Hi Alex,

I tested the new version (5.5.0.125) and this is working now correctly with 'EncodeHeaderText'. I tried all possible value's and so far I can not see any problem anymore.

ps. I indeed made a mistake in the previous post, I ment 'To' instead of 'From' off course.



In the BCC i'm not using EncodeHeaderText at the moment. Do you think it's better for EncodeHeaderText this field also?
Back to Top View iconbill's Profile Search for other posts by iconbill
 
tim
Newbie
Newbie


Joined: 01 June 2007
Location: Denmark
Online Status: Offline
Posts: 31
Posted: 11 April 2008 at 2:13am | IP Logged Quote tim

Andrew wrote:
Quote:
When you get there, let me know. I now seem to have a periodically hanging dll as well.


Do you mean the latest version of the .dll we published today hangs too?

Best regards,
Andrew


I'm currently at .123. At first I thought it was pop3/smtp that was acting up, but the log files looks ok.
Back to Top View tim's Profile Search for other posts by tim
 
tim
Newbie
Newbie


Joined: 01 June 2007
Location: Denmark
Online Status: Offline
Posts: 31
Posted: 11 April 2008 at 2:21am | IP Logged Quote tim

Is .126 good to go?
Back to Top View tim's Profile Search for other posts by tim
 
iconbill
Valued Community Member
Valued Community Member


Joined: 07 March 2007
Location: Netherlands
Online Status: Offline
Posts: 76
Posted: 11 April 2008 at 4:07am | IP Logged Quote iconbill

I mean version '5.5.0.126'. This version is working correctly with 'EncodeHeaderText'.
Back to Top View iconbill's Profile Search for other posts by iconbill
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 11 April 2008 at 5:39am | IP Logged Quote Andrew

Quote:
In the BCC i'm not using EncodeHeaderText at the moment. Do you think it's better for EncodeHeaderText this field also?


It's not necessary to encode BCC because it's eliminated from message during sending. Moreover, specifying friendly names in BCC doesn't make a sense.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide