Re: Help...try to automate sending mail using a shared profile
- From: "Ken Slovak - [MVP - Outlook]" <kenslovak@xxxxxxxx>
- Date: Thu, 31 Aug 2006 09:12:05 -0400
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
.
- Follow-Ups:
- Prev by Date: Re: PF Admin tool & Administrative Rights
- Next by Date: Re: PF Admin tool & Administrative Rights
- Previous by thread: Re: Need to read the SCL rating of messages in the Exchange Store...
- Next by thread: Re: Help...try to automate sending mail using a shared profile
- Index(es):
Relevant Pages
|
Loading