Help...try to automate sending mail using a shared profile

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top