PDA

View Full Version : Migrating ASP 3rd party mail DLL to ASP.NET Application


aCcodeMonkey
11-24-2002, 08:50 PM
All,

I am in the process of migrating (myself) and an ASP mail application to ASP.Net.

I need some advice / references as to how to instantiate the legacy ASP DLL in the ASP.Net application. I have attached the "simple version" of the ASP.Net mail form. Later I will be migrating ASP forms where users can select mailing lists stored in either MS SQL or MS Access Dbs.

Additional Info:
The ISP that the customer is using does not have SMTP loaded on the web server but has provided access to an SMTP Relay server. So I programmed the the original mail services to use the ASPMail4 SMTPSVG.DLL from ServerObjects (http://www.serverobjects.com). The
SMTPSVG.DLL is registered on both my development and ISP's production web servers.

Both web servers are W2k Adv Svr SP 3

The ASP4Mail library allows for:

Accessing remote SMTP services by simply providing a FQDN or IP address.
The ASP4Mail services can also be accessed via SQL2000 extended stored procedures. The original ASP application includes scheduled mass mailings via SQL Mail services.
Sending file attachements NOTE: The ASPMail4 services can only access a file stored locally on the server.


On my development server I have also added the DLL to IIS' In-Process Applications as a Legacy Component.

Ain't returning to "Script Kiddy" status fun?!?!? :cool:

Dale A. Mitchell
MindCrafter Web Designs (acodemonkey@hotmail.com?subject=Response: ASP.net Migration Thread)

whammy
11-24-2002, 09:00 PM
Wish I could help you with this - but I have barely scratched the surface of .NET so far. :eek:

Hopefully the classes I am taking will change that. ;) There are some people here using ASP.NET regularly though... hopefully they can help!

BigDaddy
11-24-2002, 11:57 PM
I'm taking .NET classes at the moment. Unfortunately, while I have some ideas, I don't know that I'd be able to help to the point you'd need.

I certainly don't mean any disrespect to anyone here, but I haven't seen a lot of folks here that use .NET much. Not to look like I'm advertising for anyone else, but try checking out a place like ASP.NET. They seem to have some good forums, and I read them almost daily in addition to coming here.

I don't think anyone minds me referring you to another message board, but I'm sure whammy can be sure to tell me otherwise if it's an issue. :)

http://www.asp.net/Forums/Default.aspx?tabindex=1&tabid=39

whammy
11-25-2002, 12:04 AM
Nah, I refer people to other places all the time... :)

And that WOULD be a good website to check out... I do.

aCcodeMonkey
11-25-2002, 01:37 AM
All,
I've worked part of the issue out. Thought I'd spread the wealth. :cool:

Attached is an updated version of the web page.

The first key to getting the COM object to load was something that just plain forgot.
If you look at the PAGE declaration I needed to add the ASPCOMPAT declaration.
Page Declaration

<%@ Page Language="VB" ClientTarget="UpLevel" aspcompat="true" Debug="false" %>


This allows me to use early binding to create the object as shown below. Remember that LET & SET is no longer supported in ASP.NET

Code:

' Create Mailer Object
Dim oMailer as Object
oMailer = Server.CreateObject("SMTPsvg.Mailer")


Thought the COM+ object is now instantiated it opened a nother problem that I will have to go back to ServerObjects (http://www.ServerObjects.com). The problem, is that in VB.NET, calls to Functions and Subs "MUST" be wrapped in parenthesis () requardless if there are values being passed.

Unfortunately on of the parameter arquments in the tool was programmed not to allow parens.

Code:

ASP Syntax:
oMailer.AddRecipient "Colorado Springs HDI Chapter", "cshdi@yahoo.com"
oMailer.AddCC sSentBy,sReturnAddres

ASP.NET Syntax:
oMailer.AddRecipient("Colorado Springs HDI Chapter", "cshdi@yahoo.com")
oMailer.AddCC(sSentBy,sReturnAddres)



So while I've got a little closer, still got issues. :rolleyes:


Hints to the solution I found were in the MSDN article :
Migrating to ASP.NET: Key Considerations (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspnetmigrissues.asp?frame=true)

I had it bookmarked but it was burried.


Dale A. Mitchell
MindCrafter Computer Access (acodemonkey@hotmail.com?subject=Reply to thread: Migrating ASP 3rd party mail DLL to ASP.NET Application)

whammy
11-25-2002, 01:44 AM
I guess it's a good habit I have of using parens, then. Not that that helps you any... ;)

P.S. Thanks for sharing!

BigDaddy
11-25-2002, 02:15 AM
Thanks for letting us know what's going on. I, for one, would love to see more .NET stuff here.

glenngv
11-25-2002, 02:37 AM
I think using ASP component in ASP.NET is similar in VB where you add the component in Reference dialog box. And to instantantiate objects, you have to use the New keyword since Set...CreateObject is no longer supported in .NET.
That's what I was told by my colleague. I haven't dealt with it yet.

aCcodeMonkey
11-25-2002, 05:19 AM
glenngv,

Thnx for the tip, but I am using Macromedia MX Studio to do my development.
Main reason besides the exorbinate cost of VB.net Studio is that:

I program a wide range of service and the integration of MX is very good
Even though MX does have a good quasi intellisense functionality. I am forced to "know" ASP.Net. Which is very good to force me to really learn the language & services.


Dale A. Mitchell
MindCrafter Web Designs (acodemonkey@hotmail.com)