Search The ForumSearch   RegisterRegister  LoginLogin

MailBee Objects

 AfterLogic Forum : MailBee Objects
Subject Topic: ToFriendlyName, PureToAddr problem Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Guest
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 29 March 2006 at 2:27pm | IP Logged Quote Guest

We're running into a problem with received emails (POP3) in that if the "to:" address entry has an embedded comma in the name, we can't reliably associate a name with its respective email address.

To illustrate:

To: "John Smith, Jr." <john@acme.com>,"David Jones, Esq" <david@acme.com>

The ToFriendlyName property will return John Smith, Jr,David Jones, Esq. The embedded commas will not allow us to parse the ToFriendlyName reliably and be able to associate the names with their respective email addresses.

Is there some sort of solution (or at worst, a workaround) for this problem?
Back to Top View Guest's Profile Search for other posts by Guest
 
Guest
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 30 March 2006 at 8:33am | IP Logged Quote Guest

Just as an addendum:

Thinking on it some more, I think it'd be ideal if the To: and CC: properties of the Message object were collection objects that one could iterate through - an object where we could reliably associate a name (if available) with its respective email address.
Back to Top View Guest's Profile Search for other posts by Guest
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 30 March 2006 at 11:16am | IP Logged Quote Alex

Quote:

Is there some sort of solution (or at worst, a workaround) for this problem?

The solution of this problem is to call the Message.GetFriendlyName method instead of using the Message.ToFriendlyName property as follows:

Code:

Set Msg = CreateObject("MailBee.Message")

' Get the string containing all friendly names separated with {|} delimiter
str = Msg.GetFriendlyName(Msg.ToAddr, "{|}")

' Split the entire string of friendly names into array of the strings
arr = Split(str, "{|}")

' Iterate through the string array and display each friendly name
For I = LBound(arr) To UBound(arr)
  MsgBox arr(I)
Next


The sample above firstly uses Msg.GetFriendlyName method to extract the entire string of friendly names from the Message.ToAddr property and change the delimiter to be used to concatenate the friendly names in the string from ',' to '{|}'.

Then, the entire string of friendly names is split into array of the strings by calling Split method.

After that, each friendly name is correctly displayed by iterating through the string array.

Since there were some updates of the Message.GetFriendlyName method implementation, you should download the latest MailBee Objects update along with installation instructions at:

http://www.afterlogic.com/updates/mailbee.zip


Quote:

Thinking on it some more, I think it'd be ideal if the To: and CC: properties of the Message object were collection objects that one could iterate through - an object where we could reliably associate a name (if available) with its respective email address.


Yes, you're certainly right. This idea is already implemented in MailBee.NET Objects. You can get more information at:

MailBee.NET Objects


Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Guest
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 30 March 2006 at 1:04pm | IP Logged Quote Guest

Awesome reply Alex - very much appreciated. I'll download/implement the latest version of Mailbee objects and give it a go.

Note: The version 5.4 documentation of GetFriendlyName doesn't specify the delimiter parameter as one of its arguments.

Question with regard address collection objects: Can we expect to see the name/address collection objects in the non-.NET version of Mailbee?

Thank you again for your help
Back to Top View Guest's Profile Search for other posts by Guest
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 30 March 2006 at 1:09pm | IP Logged Quote Alex

Quote:

Note: The version 5.4 documentation of GetFriendlyName doesn't specify the delimiter parameter as one of its arguments.

Yes, this parameter was added in the latest build only (upon your request).

Quote:

Question with regard address collection objects: Can we expect to see the name/address collection objects in the non-.NET version of Mailbee?

Currently, there are no plans for this (at least for MailBee Objects 5.5).

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Guest
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 30 March 2006 at 7:04pm | IP Logged Quote Guest

Wow - very nice, and very much appreciated.

Thank you again.
Back to Top View Guest's Profile Search for other posts by Guest
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 17 November 2014 at 6:27am | IP Logged Quote Alex

32-bit and 64-bit .DLLs of MailBee Objects ActiveX have been updated to provide Message.AddressDelimiter and Envelope.AddressDelimiter property.

Its default value is ", ". Can be changed to any other (such as "|" or "{~~~}") to split addresses by special string which is unlikely to happen in the address string.


http://www.afterlogic.com/updates/mailbee.zip


http://www.afterlogic.com/updates/mailbee64.zip


Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

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