Problems sending email with correct account
Posted on 2006-11-09
I have a macro that I have developed based on another users post. I set up this macro on my machine and on another employees machine. It basically forces an email to use a certain email account. We have 3 accounts. cumberland.com, gilmore.com, and our Exchange. SBS2k is the name of our exchange server and is what we use for the outgoing smtp field. Both this user and myself have all of these accounts listed in our exchange profile. Both of our outlook account listings show: Gilmore (default), Cumberland, exchange (in that order). When I send a message using Gilmore or cumberland it sends it correctly. When he sends a message, it is only received as @gilmore.com. If he doesn't use this macro, but rather manually creates a new message and selects account, it sends fine. This problem is driving me crazy as I cannot find a solution. The message in his mailbox says it was sent using Cumberland, but the recipient sees Gilmore. Below is the Macro
Dim olMessage As MailItem
Dim objFSO As New FileSystemObject
Dim objFile As TextStream
Dim strBuffer As String
Dim olkSendThroughBtn As Object
Dim olkSendAccount As Object
' Set the send-from to the Gilmore account
'olMessage.SentOnBehalfOfName = "firstname.lastname@example.org"<-- this is commented out now since I figured it isn't needed...ok?
Set olkSendThroughBtn = Application.ActiveInspector.CommandBars("Standard").Controls(3)
' Set the control index based on the position of the Gilmore account in the
' order of send through list.
Set olkSendAccount = olkSendThroughBtn.Controls(2)