Results 1 to 4 of 4

Thread: Specifying a Senders address with MAPI

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    79
    Hi all, been spending the last few hours getting to grips with MAPI, seems to be getting along fine (thanks to Buzby for the help ) Just a quich query, anyone know if there is a way to specify a senders address using MAPI or will it just use the default account in the mail client eg Outlook?

    Any suggestions are appreciated


    Cheers


    Paul
    The problem with designing something completely foolproof is to underestimate the ingenuity of a complete fool. - Douglas Adams

    I know the human being and fish can coexist peacefully. - GWB

    I think we agree, the past is over. - GWB

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    ...


    Dim oSession as MAPI.Session
    Dim NewMsg as MAPI.Message
    Dim Receiver as MAPI.Recipient
    Dim AddEntries as MAPI.AddressEntries

    'Ok...
    Dim OnBehalfOfSender as MAPI.AddressEntry

    Set oSession = CreateObject("MAPI.Session")
    oSession.Logon

    'There Create your new message
    Set NewMsg = oSession.Outbox.Mesages.Add
    ......

    'Here we go... Need to reset the current user of the MAPI
    'session object

    Set AddEntries = oSession.AddressLists(1).AddressEntries
    AddEntries.Filter = Nothing 'Reset
    AddEntries.Filter = "<User in question>"
    Set OnBehalfOfSender = AddEntries.GetFirst
    Set NewMsg.Sender = OnBehalfOfSender 'On BehalfAddress

    etc..

  3. #3
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    ...

    Sorry!

    Change this line in the previous post
    AddEntries.Filter = "<User in question>"

    to

    AddEntries.Filter.Name = "<User in question>"

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    79

    Talking Thanks very much!!

    Thanks very much Lafor, sorry it took me so long to reply
    The problem with designing something completely foolproof is to underestimate the ingenuity of a complete fool. - Douglas Adams

    I know the human being and fish can coexist peacefully. - GWB

    I think we agree, the past is over. - GWB

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