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

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Ken - thanks for responding.

I changed the code to reflect a name that I can be resolved just to see if
the mail gets sent and still nothing happened. I don't receive any error
messages...it all looks like it's working, but there's nothing in the
sender's sent items folder and the recipient doesn't receive the mail. Any
other suggestions.

Here is the changed that I implemented

Before:

Set objRecipient = objnewmessage.Recipients.Add
objRecipient.Name = "festevez@xxxxxxxxxxxxxxxxxxxx"

Changed To:

Set objRecipient = objnewmessage.Recipients.Add
objRecipient.Name = "festevez"
objRecipient.Type = CdoTo
objRecipient.Resolve

Thanks,
--
Frank Estevez


"Ken Slovak - [MVP - Outlook]" wrote:

If you substitute an email address for the name used in the original CDO
code from cdolive.com you need to use Recipient.Address instead of .Name.
You also shouldn't remove the line that resolves the recipients, especially
with Exchange Outlook is sensitive to sending without a resolved recipient.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Festevez" <Festevez@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:63CA0A98-8F29-47DE-9C11-3371626075EE@xxxxxxxxxxxxxxxx
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 = "festevez@xxxxxxxxxxxxxxxxxxxx"

objnewmessage.Update True
objnewmessage.Send True

objSession.Logoff

--
Frank Estevez


.