-
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
-
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
-
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
-
Set a reference for CDO.DLL - Microsoft Colaboration Data Objects
Cheers..