Link to home
Start Free TrialLog in
Avatar of yukinko
yukinko

asked on

Notes : Addr821 in NotesName class

Addr821 in NotesName class returns empty string if the notes mail address does not contain @Domain at the end of the address. However it does not work if @Domain exists. How can I judge the Mail address if it is a Notes mail or an E-mail address?
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Can you give some examples?
Avatar of yukinko
yukinko

ASKER

Dim name1 As New NotesName("Test/Test")
Dim name2 As New NotesName("CN=Test/O=Test")
Dim name3 As New NotesName("Test/Test@Test")
Dim name4 As New NotesName("CN=Test/O=Test@Test")

name1.Addr821    ----> return ""
name2.Addr821    --->  return ""
name3.Addr821    ---> "Test/Test@Test"
name4.Addr821    ----> "CN=Test/O=Test@Test"

So I use the next codes

Dim strDomain As String
strDomain = StrRight(nameX,"@")
If Not InStr(strDomain, ".") = 0 Then

is this proper solution? Or is there any solution to judge if Notes name is a Notes mail address or an internet mail address?
AFAIK, the name you pass to NotesName cannot contain a Notes domain (but I could be wrong).

From the Help database:
name$
    String. A name in one of the following formats:
  • Canonical hierarchical name
  • Abbreviated hierarchical name
  • Internet name (address)
  • Flat name

I assume that Notes assumes that any address with an @ in it is an Internet address. That isn't going to help you either.

What might help you is that Notes domains should not have a dot in their name.
Avatar of yukinko

ASKER

The example  I wrote is just a sample code for you. Actually I got the name from 'To' field in a mail and the name contains Notes domain. So I came across this issue.
The above workaround code is to check if "." char exists after '@' char. Do you also think this code works properly to judge if Notes name is a Notes mail address or an internet mail address??
ASKER CERTIFIED SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yukinko

ASKER

Thanks for advice. That's very helpful!