P
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();
sOut.Close();
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
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();
sOut.Close();
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