-
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
-
...
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..
-
...
Sorry!
Change this line in the previous post
AddEntries.Filter = "<User in question>"
to
AddEntries.Filter.Name = "<User in question>"
-
Thanks very much!!
Thanks very much Lafor, sorry it took me so long to reply :)