How to use P3Admin to create email accounts?

  • Thread starter Thread starter Brady Love
  • Start date Start date
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#)
 
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?
 
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?
 
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?
 
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;
}





Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
Yes. Ill try with the code you supplied and see if it works then, thank
you
 
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)
 

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

Back
Top