|
-
Aug 19th, 2002, 04:58 AM
#1
Thread Starter
Addicted Member
Email Problem
Hi
I have a problem with sending email from VB.
In the Address book there are people with the same surnames and every time i send a email it selects the incorrect recipients even if i provide the whole name like : surname,name.
How can i prevent this problem
-
Aug 19th, 2002, 05:16 PM
#2
Lively Member
Are you running a server app or a client app? If you are running on the client you could use this code to prompt the user to resolve the e-mail address...
Code:
Dim recipListCH As String
Dim recipientOB As MAPI.Recipient
Dim bracketPosNL As Long
Dim lRecipientsStringCH As String
Dim i As Integer
On Error GoTo ErrH
Set mCDOSessionOB = New MAPI.Session
mCDOSessionOB.Logon inProfileCH
Set mCDOMessageOB = mCDOSessionOB.Outbox.Messages.Add
'// Add recipients as To recipients (this is only temporary anyway)
With mCDOMessageOB.Recipients
.Delete
.AddMultiple lRecipientsStringCH, CdoTo
End With
'//--------------------------------------------------------------------------------
'// Resolve all recipients
'//--------------------------------------------------------------------------------
For Each recipientOB In mCDOMessageOB.Recipients
With recipientOB
'// Remove triangular bracketed section of name
bracketPosNL = InStr(.Name, "<")
If bracketPosNL > 0 Then
.Name = Left$(.Name, bracketPosNL - 1)
End If
'// Resolve if name is at least of minimum length
If Len(.Name) >= mMINIMUM_NAME_LENGTH_NI Then
.Resolve True
End If
End With
Next recipientOB
-
Aug 20th, 2002, 04:07 AM
#3
Thread Starter
Addicted Member
I have a Mapi control on my form but the name is mapimessages1 by default and it does not accept this
Dim recipientOB As MAPI.Recipient
Give me error!
So what did you use for this ex.
Run XP
-
Aug 20th, 2002, 06:43 AM
#4
Lively Member
Set a reference for CDO.DLL - Microsoft Colaboration Data Objects
Cheers..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|