Outlook 2002 - mailing from DB
Folks
At work we are trying to pull ourselves in to the real world and use a database to send e-mails out to people within our company using a standard format but with information specific to them included. For example we mail a manager that his team members [names] need to confirm that training has been completed etc.
I've managed to figure out how to send the mail from my own mailbox, but we also have a group mailbox that a reply from the user can be picked up from by anyone of 6 people. The question is how can I send it from the group mailbox not my own?
At the present I have send on behalf permissions to the group account, and in the FROM box on the message I select the account I want to use.
Here's the code I managed to get working:
Sub subMessageSend(sMsgBody As String, sRecipient As String)
Dim objMailItem As Outlook.MailItem
Dim sSubject As String
Set olkApp = New Outlook.Application
Set olkNameSpace = olkApp.GetNamespace("MAPI")
Set objMailItem = olkApp.CreateItem(olMailItem)
sSubject = "This is a Test Message from Access 2000"
sMsgBody = "This is the message body..." & vbCrLf & vbCrLf & sMsgBody
With objMailItem
.To = sRecipient
.Importance = olImportanceHigh
.Recipients.ResolveAll
.Subject = sSubject
.Body = sMsgBody
.ReadReceiptRequested = False
.Send
End With
Set objMailItem = Nothing
Set olkNameSpace = Nothing
Set olkApp = Nothing
End Sub
I haven't tried it yet but I guess I could create a new mail profile with just the Group Mailbox in it...
Any thoughts/suggestions gladdy accepted.
Regards
Russ (Programing on L plates..!)
__________________
Regards
Russ (Programing on L plates..!)
|