| Author |
Message |
Jordan Gomila
Guest
|
Posted:
Mon Nov 22, 2004 7:14 pm Post subject:
Logon with diferent user accounts |
|
|
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 |
|
|
"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 |
|
|
"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 |
|
|
Thanks,
I will try this.
I used SendOnBehalf. |
|
| Back to top |
|
 |
|
|
|
|