Outlook 2002/Exchange 2003 permiissons error

S

Stuart Crow

Hello all
A client has requested that a program which I look after be able
to send emails with a Word document as an attachment. The program is
written in VB6 and the OS is WIN2K.

The code to send the email is :

Dim olApp As Outlook.Application
Dim olNs As Outlook.NameSpace
Dim olMail As Outlook.MailItem

' create Outlook instance
' and set properties
Set olApp = CreateObject("Outlook.Application")
Set olNs = olApp.GetNamespace("MAPI")
olNs.Logon
Set olMail = olApp.CreateItem(olMailItem)
' email address to send to
olMail.To = mstrEmailToAddress
' from email address - allows single address for all
replies
olMail.SentOnBehalfOfName = strEMailFromAddress
olMail.Subject = "Refreshments Booking"
olMail.Body = vbNullString
' attach the Word document
olMail.Attachments.Add strAttachName
olMail.Send
MsgBox ("Email sent")
olNs.Logoff
Set olMail = Nothing
Set olNs = Nothing
Set olApp = Nothing

When I exercise this functionality from my work pc using Outlook 2002
with Lotus Notes as an email server it works OK every time.
The client, howevre, uses Outlook 2002 with Exchange 2003 as the
server.
Every time he tries to send the email he gets Outlook error
-2009661435
You do not have the permission to send the message on behalf of the
specified user.
From what they have said, they have set up a mailbox with two
profiles,
the permissions are set on the mailbox so that the user is editor and
can create items. Emails can be sent from the mailbox but nor from the
program.
Can anyone give me an idea how to fix this problem ?
TIA
Stuart
 
S

Sue Mosher [MVP-Outlook]

Check the permissions for the strEMailFromAddress mailbox. The current user
must have either Send As or Send On Behalf Of permission.
 
S

Stuart Crow

Thanks for the reply.
Unfortunately, my client has just left on two weeks holiday, so will
have to wait until he returns.
In the meantime, I have been asked to investigate using MAPI for the
VB program to communicate with Exchange directly and not use Outlook.
Stuart
 
S

Stuart Crow

Thanks for the advice.
My client returned and finally sorted it out.
Stuart
 

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