Logon with diferent user accounts
Exchange Server Forum Index Exchange Server
Discussion forums for Microsoft Exchange Server users.
Microsoft Outlook
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ExchangeServerHelp.com
Logon with diferent user accounts

 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development
Author Message
Jordan Gomila
Guest





Posted: Mon Nov 22, 2004 7:14 pm    Post subject: Logon with diferent user accounts Reply with quote

Hello,

I have a common application to send e-mails for diferent Eschanger Server
users. The problem is that I have my own account on the Exchange, and I have
to send automaticali with the account of the other users.

I use the vba throught MS Access.

The code that I am using now is:

Dim ObjOutlook As Outlook.Application
Dim ObjMailItem As MailItem

Set ObjOutlook = CreateObject("outlook.application")
Set ObjMailItem = ObjOutlook.CreateItem(olMailItem)
ObjMailItem.Recipients.Add "destination@address"
ObjMailItem.Subject = "Subject"
ObjMailItem.HTMLBody = "<html>...Body...</html>"
ObjMailItem.Send
Set ObjMailItem = Nothing
Set ObjOutlook = Nothing

But with this code all e-mail sent were on my name. I need a way to send
with the account of the other users.

I tryed the logoff and logon, but It didn't worked, I don't know how to do
this.


Kind regards
Jordan Gomila

Back to top
Dan Mitchell
Guest





Posted: Mon Nov 22, 2004 10:05 pm    Post subject: Re: Logon with diferent user accounts Reply with quote

"Jordan Gomila" <jgomila@bonninsanso.com> wrote in
news:cnsouv$ajd$1@nsnmrro2-gest.nuria.telefonica-data.net:
Quote:
But with this code all e-mail sent were on my name. I need a way to
send with the account of the other users.

Outlook will always log into an existing mail session if there's one
running -- so if you have Outlook running on your PC to read your own
mail, then the Outlooks you create from VBA will end up logged in as you.

Solution 1: don't have any Outlook session running before your code runs.

Solution 2: use CDO1.21, that can log into its own session. (or Simple
MAPI, ExMAPI, etc)

-- dan
Back to top
Dan Mitchell
Guest





Posted: Mon Nov 22, 2004 10:18 pm    Post subject: Re: Logon with diferent user accounts Reply with quote

"Jordan Gomila" <jgomila@bonninsanso.com> wrote in
news:cnsouv$ajd$1@nsnmrro2-gest.nuria.telefonica-data.net:
Quote:
But with this code all e-mail sent were on my name. I need a way to
send with the account of the other users.

Outlook will always log into an existing mail session if there's one
running -- so if you have Outlook running on your PC to read your own
mail, then the Outlooks you create from VBA will end up logged in as you.

Solution 1: don't have any Outlook session running before your code runs.

Solution 2: use CDO1.21, that can log into its own session. (or Simple
MAPI, ExMAPI, etc)

-- dan

Back to top
Jordan Gomila
Guest





Posted: Tue Nov 23, 2004 7:05 pm    Post subject: Re: Logon with diferent user accounts Reply with quote

Thanks,

I will try this.

I used SendOnBehalf.
Back to top
 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server Dedicated Servers
New Topics Powered by phpBB