473,836 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MAPI Logon error in .Net Windows service

I've written a Windows service in VB.Net that accesses the global address
list to obtain all the entries to store them in a local database. The GAL is
accessed using the MS Exchange profile on the current machine. The service
then creates a new MAPI session and then attempts to log on to the session
using the current MS Exchange profile on the machine. Here is the section of
code that is erroring:

Dim oSession As MAPI.Session
oSession = CreateObject("M API.Session")
oSession.Logon( sProfile)

sProfile is a string containing the profile name that was obtained from the

As soon as the service hits the logon line it errors giving the following

[Collaboration Data Objects - [MAPI_E_LOGON_FA ILED(80040111)]]

An MSDN article suggested trying to create a new profile at the logon line
but that produces the following error:

[Collaboration Data Objects - [UNKNOWN_ERROR(8 0010106)]]

I have tried various things such as getting the service to log on as
somebody else, I have local admin rights and domain admin rights.

Has anyone had problems using MAPI with a windows service before? I have
the same code as a windows application and it works fine.

Any help would be appreciated.
Nov 21 '05 #1
0 2190

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Adam Kinney | last post by:
I have an ASP application that logs into Exchange server to send email. The code looks like this: Set objSession = CreateObject("MAPI.Session") objSession.Logon "profileName" strMsg = ".." Set objMessage = objSession.Outbox.Messages.Add objMessage.Subject = "Customer Comment" objMessage.Text = strMsg
by: Suganthi | last post by:
Hi, I have a specific problem while using MAPI for sending the emails from my application. My requirement is as follows. My application will be running either as a service or a process in a windows 2000/NT server. For a given user (who is Windows NT user) in the same Windows 2000
by: Sandy Beach | last post by:
Hi, I have an app, written in c#, that checks an email inbox (using cdo/mapi) and does some processing. I've written a function "WriteToLogFile (string text, bool onConsole)" that checks whether the logfile exists (creates it if not), appends the text to the file, closes the file and displays it on the console, if required. It uses StreamWriter to accomplish this.
by: Jay McGrath | last post by:
Help - trying to send a simple text email with with as little user intervention. I am trying to create a button in my Access application that will automatically send a simple text email. It works except that I have two warning nuisances: 1) Program is trying to access email Addresses you have stored in Outlook. Allow access for ... 2) A program is trying to automatically send email on your behalf ... Heck, I am only trying to a send...
by: DC Fan | last post by:
I am wirting an application in Access 2002 (XP) that needs to send email. Since I hate the dialog boxes you get from all the Outlook warning messages, I am trying to use the MAPI object. On *SOME* PC's the code runs fine, but on others, the code can execute the logon portion of the code just fine, but when it tries to create a message, I get the following error codes: -2147221219, which when I look it up is MAPI_E_FAILONEPROVIDER. I can...
by: Ottar | last post by:
I've made a program sorting incomming mail in public folder. The function runs every minute by using the form.timer event. In Access XP it runs for weeks, no problem. Access 2003 runs the same code for 6 hours and stops. I've found the problem to be the Set MySession = CreateObject("MAPI.Session")
by: Michael Zino | last post by:
Hi All, I'm having problems with ex MAPI when its running from an NT service. This is the code i'm running in the log on process. Please... if you can see ANY problem, let me know....
by: Sid | last post by:
hi all, i'm using mapi in my application and create a mapi session using MAPILogonEx passing it the profile name (that is created dynamically by my program). Now from a windows NT/2k machine when i access the inbox of the person logged into the machine everthing works fine as i'm able to get the mails but when i want to access some other mailbox's mails. i get an error. could someone help me here? it is important to access any mailbox without...
by: Kevin Quigley | last post by:
Hi, I have a web page that will send emails to various addresses, I've tried using the SmtpMail class but no matter what I try it will not work. I have an asp page that does actually work using mapi.session... <% Const cStrServer = "sciehex01" Const cStrMailbox = "weeklyreportuser"
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.