473,748 Members | 6,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem creating exchange mailbox through an ASP.NET application

Hello Group,

I am relatively new to .NET. I am trying to create a user in AD and a
corresponding email account in the exchange server from an ASP.NET, C#
application.

-----------------------------
I have a problem wherein I am able to create a user but am
unable to create a mailbox for the user. I "WAS" using exchange 2000.

The error that I was getting is a class cast exception when I try to do

this:

DirectoryEntry user1 = new DirectoryEntry( path, username, password);
IMailboxStore mailbox;
//exception caused in the next line
mailbox = (IMailboxStore) (user1.NativeOb ject);

Exception Details: System.InvalidC astException: Specified cast is not
valid.

I have read that CDOEXM does not work in asp.net. Most of the
discussions suggest using a COM object. I do not know how to deal with
COM objects or how they work. I dont know if the above error is well
before the execution needs the CDOEXM specific alteration or if its
just someother error.
-----------------------------

Anyways, now I am at a stage where, I have a seperate domain setup just

to test this application and that runs WIN 2003 and Exchange 2003 SP 2.

I want to not be able to do the same here on the new domain.
1) Create a user in AD and
2) Create a corresponding Mailbox through a asp.net, C# application.
I am able to do the first task. Could any of you provide some code for
creating an email account through an asp.net application and show how
the COM object would be implemented in C# and used from the asp.net
application.
OR
I still have access to the previous environment. If something strikes
you looking at the exception that I was getting in the previous domain
and that can be fixed to create email accounts in the Exchange 2000,
that should be fine too.
I would be really thankful to you for any help provided. I have been
trying to complete this project for a really long time now.
Thanks a lot in advance.
Suman

Aug 16 '06 #1
0 1576

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

Similar topics

0
1924
by: Manuel Krummenacher | last post by:
Hello! I'm trying to develop an application to manage email-forwardings on an Exchange 2000 Server. Forwardings to external Addresses are requiring a contact with an Exchange account. I can create the contact in the Active Directory, but when I try to create an Exchange Account, I get this error (translated from German):
0
1295
by: Ouaes Jamali | last post by:
I am using C# and ASP.Net to create users and mailboxes. I can create an user without any problems but the code Blows up when i try to create a mailbox. Here is the code snippet is am using DirectoryEntry de = new DirectoryEntry(); DirectoryEntry ParentEntry = new DirectoryEntry(); CDOEXM.IMailboxStore Mailbox; ParentEntry.Username = username; ParentEntry.Password = password;
1
1954
by: B. Zuidgeest | last post by:
I use C# to connect a database with student information directly to the Active Directory (2003). This means that as the student is enlisted an account and mailbox is created in the active directory. Creating users is flawless en mailbox creating went perfect against a single exhange server using code from KB article 313114 of which part is displayed below. mailbox = (IMailboxStore)user.NativeObject; mailbox.CreateMailbox(homeMDB);...
5
6009
by: Jason | last post by:
I am running Exchange 2003 on a Windows 2003 Active Directory. I am trying to mailbox-enable a user account with VB.NET. Dim person As CDO.Person Dim mailbox As CDOEXM.IMailboxStore person = New CDO.Person person.DataSource.Open("...") mailbox = person mailbox.CreateMailbox("...")
0
1188
by: Flens | last post by:
Hi, I have code that worked until we upgraded from Exchange 2000 to Exchange 2003 and I now get a catastrophic failure at CreateMailbox (COMException (0x080004005)) I have updated the CDOEXM.dll (Version: 6.5.6944.0) as well. private void CreateMailbox(string homeMDB,DirectoryEntry CurrUser)
4
3516
by: Tarren | last post by:
Hi, All: I am tasked with the following. I need to write a service to monitor an Exchange mailbox and take action when an email is received, put it in a db, etc. I do not need to send emails through MAPI, only monitor a folder in exchange. Can I use .NET objects to do this or do I absolutely need a 3rd party add-in such as Outlook Redemption. This has to go on an enterprise production server, so the server group will fight me hard...
5
15864
by: =?Utf-8?B?RGF2aWRF?= | last post by:
Hi, I have to write an application that run once a day that can read all new mails on an exchange special inbox. Then I have to get the subject,attachments,date etc from each email . How can I do it ? I use vs 2005. We have exchange 2003 . Thanks,
4
17678
by: pjblecha | last post by:
Hello all: I'm working on a non-web-based (darn it...) application that will be set up as a scheduled task on an Exchange server to run against a mailbox 2-3 times per day. What the app needs to do is read messages in the mailbox, then create appointment items based on filtering the subject line and parsing text from the message body (which will be in HTML format). I have old VBScript that will create the appointment items, set them to a...
0
1206
by: KunalDesale | last post by:
Hi, I have developed an application in VB.NET 2005 which downloads xml attachments. I have used CDO for reading mails from the exchange server. Application reads mails in the mails box after every 3 minutes (Timer is set to 3 minutes). If there are new mails in the inbox than it downloads xml attached to mail and make that mail as read. Application starts at 8.00 a.m. and stops at 5.00 p.m. automatically. I have installed this application...
0
8987
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9534
Oralloy
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...
0
9366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9316
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,...
0
6073
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();...
0
4597
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...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2211
bsmnconsultancy
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.