What did VB replace the function "Set" with?

Deena picture Deena · Sep 24, 2009 · Viewed 24.8k times · Source

I've found several aspx codes for forms which include the use of a "Set" function. When I try them out on the hosting server, I get an error message that "Set is no longer supported". Anyone know what replaced the "Set" command?

More specifically, how do I change this:

Dim mail 
Set mail = Server.CreateObject("CDONTS.NewMail") 
mail.To = EmailTo 
mail.From = EmailFrom 
mail.Subject = Subject 
mail.Body = Body 
mail.Send

to be VB.NET compatible?

Answer

ChaosPandion picture ChaosPandion · Sep 24, 2009

If you mean the VB6 syntax

Set obj = new Object

then you can simply remove the Set

obj = new Object()