I have written a VB.NET console application that sends e-mails to users. I need to call this app from ASP.NET after a user clicks on submit. I called my .exe from ASP.NET directly, but there were no e-mails. I also tried to call the .exe through DLL, which is called by ASP.NET, but to no avail. I am not getting any error but no output.
One more thing: How can I pass parameters to my .exe app from ASP.NET?
There's built-in support for mail in ASP.NET. Take a look at the System.Web.Mail namespace. You can easily send mails from there. As for passing parameters to a .exe, you should use the ProcessStartInfo and Process classes in the System.Diagnostics namespace:
ProcessStartInfo i = new ProcessStartInfo("myexe.exe", "-arg1 -arg1 -others"); Process p = new Process(); p.StartInfo = i; p.Start();
Dig deeper on ASP.NET development best practices
Related Q&A from Daniel Cazzulino
Here Daniel Cazzulino explains how to load a DSL (domain specific language) domain model instance file programmatically. This requires the .NET type ...continue reading
Here we offer a glimpse at 12 of .NET development expert Danny Cazzulino's top ASP.NET questions and answers.continue reading
C# developers should NOT be modifying InitializeComponent method in the code-behind (or any of the variable definitions) by hand.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.