I am currently working on a database that will be sending out multiple reports but they need to be sent from different e-mail profiles. I have the two profiles set up but I am at a loss with how to select which profile to use in my code.
Here is a sample:
I thought about using the 'SentOnBehalfOfName' property but from what I've seen this does not change the e-mail address. This is key since the recipients will probably reply back and these replies need to be routed to the correct profile.
Here is a sample:
Code:
Dim obEmail As Object, obMsg As Object, obAttachment As Object, stDelim As String, exAttach As String
stDelim = ";"
Set obEmail = CreateObject("Outlook.Application")
Set obMsg = obEmail.CreateItem(olMailItem)
With obMsg
.subject = "Ordering Report"
.To = "users"
.Body = "Please see attached."
.Send
End With
Set obEmail = Nothing
Set obMsg = Nothing
End Function
I thought about using the 'SentOnBehalfOfName' property but from what I've seen this does not change the e-mail address. This is key since the recipients will probably reply back and these replies need to be routed to the correct profile.