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?
Can you give some examples?
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?
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@
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:
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.
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.
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??
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for advice. That's very helpful!