1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Using ASP NET and mail.exe to Create Email Accounts / Mailboxes

Discussion in 'Plesk for Windows - 8.x and Older' started by petcoop05, Jul 6, 2005.

  1. petcoop05

    petcoop05 Guest

    I am trying to use mail.exe to create email accounts in ASP NET. If I run mail.exe through the command line on the server itself I can add an account. But when I run it through ASP NET (through c# in an ASPX file) nothing seems to happen, and the account is never created.

    From what I can tell I think the command line is giving the following response when mail.exe is run form the ASPX file.

    Error 5 at Connect to pipe: Access is denied.
    at (vpipechannel::client::connect line 200)
    at get shared instance of PleskSrvClient(PleskSrvClient::getInstance line 222)
    at Unable to execute CU(wmain line 107)]

    My first thought was the problem had something to do with having permission to run exe files. But this does not seem to be the problem.

    The code is:

    string exefile="c:\\Program Files\\swsoft\\plesk\\admin\\bin\\mail.exe";

    System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(exefile);
    psi.UseShellExecute = false;
    psi.RedirectStandardOutput = true;
    psi.RedirectStandardInput = true;
    psi.RedirectStandardError = true;

    System.Diagnostics.Process proc = System.Diagnostics.Process.Start(psi);

    System.IO.StreamReader sOut = proc.StandardOutput;

    string results = sOut.ReadToEnd().Trim();


    Response.Write("["+ results.Replace(System.Environment.NewLine, "<br>") + "]");

    I have tried using diffrent code, but I keep on getting the error. How do I create email accounts from ASP NET? Can I directly edit a database?

    Thank You,

    Nick Clark
  2. botsman

    botsman Guest

    as far as I know asp.net applications is run under application pool users (IWPD_someuser) , but I suppose that mail.exe should be run only by administrators.... try to add this appl pool user to addministrators group...
    but in this case you'll get the hole in server security of course...