|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
对于中小型web应用来说,php有很强的竞争力,linux+apache+mysql+php(lamp)的组合几乎可以胜任绝大多数网站的解决方案,对于大型应用来讲,对于系统架构要求更高,需要有成熟的框架支持,jsp的struts是个不错的框架,国内介绍它的资料也非常多,应用逐渐广泛起来。asp就不用说了,发邮件|发邮件Introduction
CDONTSwasactuallyreplacedbyCDOalreadyinWindows2000andWindowsXP.ButtheseOperatingSystemssupportedCDONTS,andyoucoulduseCDONTS.WindowsServer2003doesnotsupportCDONTS,andweareforcedtouseCDO.ThistutorialisacrashcourseinCDO,andwewillcreateafewsimplewebformsforsendingemailswithCDOandASP.
Beforewebegin
BeforeIshowyouanycode,thereareafewthingswemustdotogetthistowork.ThefirstthingissetupawebserverCIIS6.0.YoucanstartthewizardfortheinstallationofIIS6.0fromManageYourServer(Start->Programs->AdministrativeTools->ManageYourServer).
ClickAddorremovearole.
SelectApplicationServer
YoudonotneedASP.NETnorFrontPageServerExtensionsforthistutorial
Butthatisnotenough;wealsoneedtheSMTPservertosendouremails,thoughIwillalsoshowyouhowtousearemoteserverinsteadofthelocal.So,openupAddorRemoveProgramsfromtheControlPanel.
ClickAdd/RemoveWindowsApplications
HighlightApplicationServer,andclickDetails
HighlightInternetInformationServices(IIS)andclickDetails
SelectSMTPServiceandclickOK,andfinallyNext
Wearealmostreadyforthecodewritingnow,butsinceIIS6.0islockeddownbydefault,wehavetogototheInternetInformationServicesManager(Start->Program->AdministrativeTools)andenabletheaspextension.
WhentheIISManagerhasstarted,clickonWebServiceExtensionsintheleftpane.
SelectActiveServerPages,andclickonAllow
That’sit!Wearenowreadyforthefunpart,thecoding!
Asimpletextemail
So,startyourfavoritetexteditor,andtypethis:
01|<%
02|IfRequest.Form("btnSend").Count>0Then
03|
04|SetobjMessage=CreateObject("CDO.Message")
05|objMessage.Subject=Request.Form("subject")
06|objMessage.Sender=Request.Form("From")
07|objMessage.To=Request.Form("To")
08|objMessage.TextBody=Request.Form("message")
09|objMessage.Send
10|Response.Redirect("Sent.html")
11|EndIf
12|%>
13|
14|<html>
15|<head>
16|<title>SendemailwithCDO</title>
17|</head>
18|<body>
19|<formname="sendEmail"action="EmailWithCDO.asp"method="post">
20|<table>
21|<tr>
22|<td>Subject:</td>
23|<td><inputtype="text"name="subject"/></td>
24|</tr>
25|<tr>
26|<td>From:</td>
27|<td><inputtype="text"name="from"/></td>
28|</tr>
29|<tr>
30|<td>To:</td>
31|<td><inputtype="text"name="to"/></td>
32|</tr>
33|<tr>
34|<tdvalign="top">Message:</td>
35|<td><textareaname="message"rows="6"cols="30">
36|</textarea></td>
37|</tr>
38|<tr>
39|<tdcolspan="2"><inputtype="submit"name="btnSend"
40|value="Send"/></td>
41|</</p>Windows本身的所有问题都会一成不变的也累加到了它的身上。安全性、稳定性、跨平台性都会因为与NT的捆绑而显现出来; |
|