F
Festevez
Here's the scenario...our customer service area sends mail to clients from
their personal profile and when clients respond sometimes the cs rep has left
and transitioned work to another rep. They have a shared mailbox that is
monitored by the shift manager and we would like to use that mailbox as the
sender so that replys go back to the shared profile.
The emails are created from an access application that pre-generates the
email with certain pieces of data and in it's simplest form the
DoCmd.SendObject was working fine, but that won't work for this task from
what I gather. I've put together some code as I've researched this, but no
messages are going out...could someone take a look and let me know what I'm
doing wrong thanks.
Dim objnewmessage As MAPI.Message
Dim objSender As MAPI.AddressEntry
Dim objSession As MAPI.Session
Set objSession = New MAPI.Session
objSession.Logon "CustSvc", "PWD", False, True, 0
Set objSender = objSession.CurrentUser
Set objnewmessage = objSession.Outbox.Messages.Add
Set objnewmessage.Sender = objSender
objnewmessage.Subject = "This is a message created with CDO"
objnewmessage.Text = "Welcome to the world of CDO. Enjoy your life!"
Set objRecipient = objnewmessage.Recipients.Add
objRecipient.Name = "(e-mail address removed)"
objnewmessage.Update True
objnewmessage.Send True
objSession.Logoff
their personal profile and when clients respond sometimes the cs rep has left
and transitioned work to another rep. They have a shared mailbox that is
monitored by the shift manager and we would like to use that mailbox as the
sender so that replys go back to the shared profile.
The emails are created from an access application that pre-generates the
email with certain pieces of data and in it's simplest form the
DoCmd.SendObject was working fine, but that won't work for this task from
what I gather. I've put together some code as I've researched this, but no
messages are going out...could someone take a look and let me know what I'm
doing wrong thanks.
Dim objnewmessage As MAPI.Message
Dim objSender As MAPI.AddressEntry
Dim objSession As MAPI.Session
Set objSession = New MAPI.Session
objSession.Logon "CustSvc", "PWD", False, True, 0
Set objSender = objSession.CurrentUser
Set objnewmessage = objSession.Outbox.Messages.Add
Set objnewmessage.Sender = objSender
objnewmessage.Subject = "This is a message created with CDO"
objnewmessage.Text = "Welcome to the world of CDO. Enjoy your life!"
Set objRecipient = objnewmessage.Recipients.Add
objRecipient.Name = "(e-mail address removed)"
objnewmessage.Update True
objnewmessage.Send True
objSession.Logoff