How to use P3Admin to create email accounts?

B

Brady Love

I am very new to asp.net and I am currently working on an application
that when users sign up it also creates a email account for them.I have
done some reserch and found that this is possible to do using
P3admin.dll but for the life of me I cannot figure out how. Has anyone
successfully done this and/or have an example I could look at? (C#)
 
B

Brady Love

I have been looking at that but I am having a hard time converting it
to c# (never worked with visual basic before) Is there anyone that can
help me out there?
 
B

Brady Love

I have been looking at that but I am having a hard time converting it
to c# (never worked with visual basic before) Is there anyone that can
help me out there?
 
B

Brady Love

I think i found the problem, which isnt fixable i dont think. I am
guessing the reason I cannot get it to work is because my webserver
doesnt have the p3admin.dll registered? Would that cause any problems?
 
J

Juan T. Llibre

http://www.carlosag.net/Tools/CodeTranslator/default.aspx
....should give you a good headstart:

public P3ADMINLib.P3User AddPop3User(string MachineName, string UserName, string DomainName, string
Password) {
// get a configuration object.
P3ADMINLib.P3Config P3 = new P3ADMINLib.P3Config();
// get the object from a VB Script/JScript
// Set P3 = CreateObject("P3Admin.P3Config")
// Connect To the remote computer.
if ((MachineName.Length > 0)) {
P3.MachineName = MachineName;
}
P3ADMINLib.P3Domain Domain;
P3ADMINLib.P3User User;
// get the domain object
// TODO: On Error Resume Next Warning!!!: The statement is not translatable
Domain = P3.Domains.Item[DomainName];
if ((Err == 2147942403)) {
// The domain is registered In SMTP but Not In POP3
}
else if ((Err == 2147943755)) {
// the domain does Not exist. Create it.
// TODO: On Error Resume Next Warning!!!: The statement is not translatable
P3.Domains.Add;
DomainName;
if ((Err != 0)) {
// On Error GoTo 0
Err.Raise;
Err;
("Domain "
+ (DomainName + " cannot be added."));
}
}
// add a user account
Domain.Users.AddEx;
UserName;
Password;
if ((Err == 134246480)) {
// ERROR_FILE_EXISTS
// the user account already exists.
// do some action In this Case.
}
// get the created user account
User = Domain.Users.Item[UserName];
return User;
}
 
B

Brady Love

Okay I tried with your code and here is what I got. I guess ill have to
see if my host will register the dll :(

Retrieving the COM class factory for component with CLSID
{27AAC95F-CCC1-46F8-B4BC-E592252755A9} failed due to the following
error: 80040154.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException:
Retrieving the COM class factory for component with CLSID
{27AAC95F-CCC1-46F8-B4BC-E592252755A9} failed due to the following
error: 80040154.

Source Error:

Line 27: public P3ADMINLib.P3User AddPop3User(string MachineName,
string UserName, string DomainName, string Password)
Line 28: {
Line 29: P3ADMINLib.P3Config P3 = new P3ADMINLib.P3Config();
Line 30:
Line 31: if (MachineName.Length > 0)
 
Joined
Apr 27, 2007
Messages
1
Reaction score
0
Need help regarding remote pop3 user registration

Hi,

I am getting the following error whenever trying ti register from remote machine.For local machine it is working properly.Please help me out.


System.IO.DirectoryNotFoundException: The system cannot find the path specified. (Exception from HRESULT: 0x80070003) at P3ADMINLib.P3DomainsClass.get_Item(Object vIndex) at register.AddPop3User(String MachineName, String DomainName, String UserName, String Password) in c:\inetpub\wwwroot\mail.veoda.com\mail\register.aspx.cs:line 118 at register.ImageButton1_Click(Object sender, ImageClickEventArgs e) in c:\inetpub\wwwroot\mail.veoda.com\mail\register.aspx.cs:line 167
 
Joined
Jan 30, 2008
Messages
1
Reaction score
0
Hello!
I know this is an old thread, but can anyone post the c# code that works to acheive this goal?

I can get it working in VB.Net but not in C# even though it is just a simple language conversion..

Thanks
Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,184
Messages
2,570,979
Members
47,580
Latest member
kim2namjoon

Latest Threads

Top