一、邮件发送组件:
a) 功能:可使用ASP程序发送邮件
b) 使用例程:
Set objMail = Server.CreateObject("CDONTS.NewMail") '!!!!!!!!!!!!!!!!!!!!!
objMail.To = mymail 'set To address
objMail.From ="xujian@chinadns.com" 'set 'From' address
objMail.Subject ="Hi" 'set the subject line
objMail.Body = CardAdd 'set the message content
objMail.Send 'and send the message
if err.number<>0 then Response.Write "Error:"+cstr(err.number)+err.description+chr(10)+"对不起,本服务器正在调试,无法发送"
Set objMail = Nothing 'then de
二、文件上传组件:
a) 功能:上传文件
b) 使用例程
set uploadform = Server.CreateObject("SiteGalaxyUpload.Form")
if uploadform.ContentDisposition <> "form-data" then
Response.Write "Bad request format"
Response.End
end if
if uploadform.Item("imagefile").MimeType <> "image" then
Response.Write "Image expected"
Response.End
end if
if uploadform.Item("imagefile").Size > 10240 then
Response.Write "Image size is limited to 10KB"
Response.End
end if
if uploadform("submitdisk") <> "" then '
save to disk
set fs = server.CreateObject("Scripting.FileSystemObject")
fn = server.mappath("/")& "\" & fs.GetFileName(uploadform("imagefile").FilePath)
set fs = Nothing
uploadform("imagefile").SaveAs(fn)