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



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

.



Relevant Pages

  • Re: Possible to Disable Object Model Guard?
    ... Message.Configuration details for CDO. ... I know almost nothing about programming Outlook. ... Dim OutMail As Object ... Dim cell As Range, FileCell As Range, rng As Range ...
    (microsoft.public.outlook.program_vba)
  • Re: Permanent Delete
    ... I have CDO enabled in Outlook 2000 SR-1, ... Dim objSession As New MAPI.Session" ... Sub PermanentlyDeleteSelectedMessges() ... Set objItem = objItems.Item ...
    (microsoft.public.outlook.program_vba)
  • RE: Using cdo in MS Access VBA to automate email
    ... I use the Outlook object model in Office 2007, you can use it in 2003 too. ... In the past I used cdo when I wanted to get an ACCOUNT,DISPLAY_NAME, ... Dim olApp As Outlook.Application ... Dim olAddressAs String ...
    (microsoft.public.access.modulesdaovba)
  • RE: Using cdo in MS Access VBA to automate email
    ... Is there a limit to the number of recipients that can be added to the email? ... I use the Outlook object model in Office 2007, you can use it in 2003 too. ... In the past I used cdo when I wanted to get an ACCOUNT,DISPLAY_NAME, ... Dim olApp As Outlook.Application ...
    (microsoft.public.access.modulesdaovba)
  • Re: COM addin outlook 2003
    ... You aren't using the EntryIDCollection you are passed in NewMailExat all, that is a string value of EntryID's with each id separated from the next one by a comma. ... Second, CDO 1.21 is not supported for use in managed code, as I also mentioned. ... Dim objOutlook As Outlook.Application ... One more doubt is it possible to display the header when i click the newmail ...
    (microsoft.public.office.developer.com.add_ins)

Loading