Results 1 to 4 of 4

Thread: Email Problem

  1. #1

    Thread Starter
    Addicted Member chatty's Avatar
    Join Date
    Aug 2002
    Location
    in a house
    Posts
    202

    Question 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

  2. #2
    Lively Member tgoodmannz's Avatar
    Join Date
    Sep 2000
    Location
    Mid On at the Pavillion End
    Posts
    102
    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

  3. #3

    Thread Starter
    Addicted Member chatty's Avatar
    Join Date
    Aug 2002
    Location
    in a house
    Posts
    202
    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

  4. #4
    Lively Member tgoodmannz's Avatar
    Join Date
    Sep 2000
    Location
    Mid On at the Pavillion End
    Posts
    102
    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
  •  



Click Here to Expand Forum to Full Width