I have an ASP.NET (VB.NET) application, which has a class called clsSendEmail within it. I use this class from within the application to send a test email. What I want to do is create a console application, which will run completely independent of the web application, but is able to call the SendEmail class that is located within the Web app. How can I call the constructor of the SendMail class from outside the ASP.NET Application???
Example
VB Code:
'My ASP.NET Application Public Class clsSendMail Public Sub New(ByVal strServerName As String, ByVal strDBName As String) 'Create a new instance of teh SendMail Class Dim Mail As New SendMail(strServerName, strDBName) End Sub Private Class SendMail() 'misc variable declarations Public Sub New(ByVal strServerName As String, ByVal strDBName As String, Optional ByVal blnTestEmail As Boolean = False, Optional ByVal strMailingID As String = "") 'Do my email processing here, based on the parameters passed. End Sub End Class End Class
Here would be my console application that would be able to call the clsSendMail constructor
VB Code:
Public Class ConsoleSendMail 'What needs to be in this class to be able to call the 'clsSendMail class in the ASP.NET Application??? End Class




Reply With Quote