Wednesday, December 14, 2005

ASP:SENDING EMAIL

dim str, mailobj
str="Email Metini"
'response.Write str // Gerekirse e-mail string kontrol
set mailobj = server.createobject("CDO.Message")
mailobj.Subject="ASP EMAIL"
mailobj.From="gonderen"
mailobj.To="
asp@asp.com.tr"
'mailobj.TextBody = str
mailobj.HTMLBody = str
mailobj.Configuration.Fields.Item("
http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
mailobj.Configuration.Fields.Item("
http://schemas.microsoft.com/cdo/configuration/smtpserver") = "asp.com.tr"
mailobj.Configuration.Fields.Item("
http://schemas.microsoft.com/cdo/configuration/smtpserverport
") = 25
mailobj.Configuration.Fields.Item("
http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
mailobj.Configuration.Fields.Update
mailobj.Send
if err.number=0 then
Response.Write "HATA OLUSTU"
else
Response.Write err.number & err.description
end if

Sunday, December 11, 2005

ASP

What is ASP?
In the dim and distant past, web developers wishing to create more than just static displays of information turned to CGI (Common Gateway Interface) and Perl to introduce some sort of interaction to their pages. While this approach worked (and indeed, many sites still use it today), CGI was not by any means fast and the quest for an alternative means to create a page dynamically continued. ISAPI came and went – primarily because it required more knowledge to create a dynamic filter than web programmers were prepared to learn. Finally came web scripting languages and with them Microsoft's Active Server Pages: a server-side scripting technology for building web pages that are both dynamic and interactive.

An Active Server Page itself is simply a text file script with the extension .asp containing HTML, client- and server-side script. The implementation behind the ASP page was created by Microsoft and intended as an open technology server-side framework, giving web developers the freedom to develop dynamic web sites using information accessed from the many COM-compliant data sources available to them.

The syntax and grammar of ASP is easy to comprehend, and yet powerful enough to:
support some interaction between page user and server
allow web page access to databases and directory services
incorporate and make use of high-powered COM components
It's also server-based, and therefore browser-independent, leaving you only the problems of which cross-browser client-side script and stylesheet you want to use.

Writing ASP pages is straightforward:
The static content of the page is created using HTML and text. We can also use standard HTML forms to question the client and, using ASP, create a page that incorporates their answers into the text. This is the simplest form of client-server interactivity using ASP.
We make calls to one or several of the ASP intrinsic objects to create the dynamic element of the page. ASP provides a set of intrinsic objects – Response, Request, Application, Server and Session – that allow us to access information about the request being made of the server, as well as the response that the server will send.
We also have access to the functionality of our standard scripting languages (VBScript, JScript and JavaScript) and the scripting objects they expose.
Finally, we can incorporate any standard COM object (or active server component, as we call them) into a page. There are many third-party companies who specialize in writing such components and if you do use them, then you have the added guarantee that they've been stress-tested and fully debugged. On the other hand, if you need your component to do something unique, COM components are easy to develop in any established language. Visual Studio would be a good investment at this point.
So now that we know what ASP is, where can I get an ASP scripting engine from?
Where Can I Get ASP?ASP is a web enhancement tool that was developed and distributed by Microsoft. As such, the ASP scripting host (which translates ASP into HTML) is distributed within Microsoft's web-specific products – its web servers, Internet Information Server (IIS) and Personal Web Server (PWS) and its HTML editors (FrontPage 9x and Visual Interdev, though not Notepad ;-). In the spirit of the open standard that ASP wants to be, the scripting host has also been taken by third parties and rewritten for use with other, non-Microsoft web servers – more on that later.
To date, there have been two versions of ASP for development use. The first, ASP 1.0, appeared in 1996 with Windows NT4 Service Pack 3 as part of IIS 3.0. ASP 2.0 reared its head about nine months later, much improving on its previous incarnation – it is this version which is available for installation with a web server/html editor from quite a few sources. The latest version, ASP 3.0, is due to ship some time in the first half of 1999 with IIS 5.0 (as part of Windows 2000. Since ASP 3.0 is currently not widely available (and is still in beta), we'll concentrate on ASP 2.0 in this book, which you can install from the following sources.
Windows NT 4.0 Option PackContrary to its rather specific name, the Windows NT 4.0 Option Pack comes in two different flavors (the choice depends on which operating system you are using). If your system set-up is based upon Windows 95 or Windows NT 4 Workstation, then ASP will be installed with Personal Web Server. If you use Windows NT 4 Server, then ASP is installed with Internet Information Server.

The Option Pack is available from several different sources:
MSDN subscribers will find it on Disk 2 of the BackOffice Test Platform or
Disk 13 of the Development Platform.
Other users can download it from the Microsoft home site at http://www.microsoft.com/ntserver/nts/downloads/recommended/NT4OptPk/default.asp. The total pack is 27Mb, so be prepared for a long wait – and no, there isn't an option to download just IIS and ASP.
Windows 98 Install DiskThe Windows 98 Install Disk includes a version of Personal Web Server and ASP as an extra to the operating system itself. Simply run setup.exe from the add-ons/pws directory of the disk and all will be well.
Visual Studio 6Personal Web Server and IIS, and therefore ASP, are included with this product.
Installation and Setup under Windows NT 4.0Windows NT4.0 can be a tricky beast to set up, and getting the latest version of ASP running with the latest hotfixes for security holes and other bugs can be a matter of trial and error unless you know the right order in which to install your software. For an NT 4.0 web server running ASP, it would be preferable to get a copy of the NT 4.0 Option Pack and then install in this order:
Windows NT 4.0 Server/Workstation
NT 4.0 Service Pack 3
Internet Explorer 4.01 (or later)
NT 4.0 Option Pack (or other source of ASP)
NT 4.0 Service Pack 4
Service Pack 3 is required to install the Option Pack, but in its turn the Option Pack contains older files than SP4 which contains the latest hotfixes (upto November 1998 anyway). Check out the Microsoft security or downloads sites for the fixes after SP4 (see Appendix H for URLs).