Data-Man
asked on
Retrieve E-mail from Exchange Server 2003 using VBA
Hi there,
I have an Access application that automically sends e-mails (Work Orders) to various vendors. There is a specific return e-mail address for support of this. Instead of having all the various personnel setup to monitor this account, I would like to pull all the e-mails from that account in to my Access application. I don't want to have to go through outlook, I would like to communicate directly with exchange server e-mails for a specific account.
We are running Windows Advanced Server 2003, Terminal Services, Exchange Server 2003.
Any thoughts?
Thanks,
Mike
I have an Access application that automically sends e-mails (Work Orders) to various vendors. There is a specific return e-mail address for support of this. Instead of having all the various personnel setup to monitor this account, I would like to pull all the e-mails from that account in to my Access application. I don't want to have to go through outlook, I would like to communicate directly with exchange server e-mails for a specific account.
We are running Windows Advanced Server 2003, Terminal Services, Exchange Server 2003.
Any thoughts?
Thanks,
Mike
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the code example...I'm having problems setting a reference....sometimes I hate terminal services.....the registry permisisons go haywire....UUUUGGGGGGHHHHH .
I'll keep you posted.
I'll keep you posted.
ASKER
I need more time for testing the solution. Thanks for the code example. If I need more help, I'll post another more detailed question....thanks again....Mike
ASKER
One other comment...what if the profile doesn't exist...I would rather not create one. Can I just specify the account and password? What would that look like?
Thanks,
Mike
Thanks,
Mike
Yes. In my sample code, I do exactly that:
objSession.Logon profileInfo:=GetParamStr(" MAPIExchSe rver") & vbLf & GetParamStr("MapiUser")
This in essense creates a temporary profile. By using the profileinfo parameter of the Logon method (rather than specifying a profile), I am in essense bypassing the need for a profile which bypasses the need for the user to be logged onto the machine.
The form for profileInfo is basically the string for your exchange server, a line feed (vbLf), and then the string for your username.
objSession.Logon profileInfo:=GetParamStr("
This in essense creates a temporary profile. By using the profileinfo parameter of the Logon method (rather than specifying a profile), I am in essense bypassing the need for a profile which bypasses the need for the user to be logged onto the machine.
The form for profileInfo is basically the string for your exchange server, a line feed (vbLf), and then the string for your username.
For further clarification, I didn't need a password in my case because it ran as a scheduled service under a specific account. I am not certain because I haven't tried this, but you might try using the profilepassword parameter of the logon method and see if that will allow you to do what you want.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdo/html/_olemsg_logon_method_session.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdo/html/_olemsg_logon_method_session.asp
ASKER
Mike