fromaddr = trim(uploadform("fromaddr"))
' request
.
toaddr = trim(uploadform("toaddr"))
subject = uploadform("subject")
html = uploadform("html")
if html = "on" then 'html
html = 1
else
html = 0
end if
body = uploadform("body")
attach_file = uploadform("file")
attach_file = trim(attach_file)
if (attach_file = "")
then '÷ Ȯ
attach_count = 0
else
attach_count = 1
end if
if attach_count = 1
then '÷ ó
filename = mid(attach_file, instrrev(attach_file,
"\") + 1) '̸
̾Ƴ
strfile = server.mappath(".")&
"\upfiles\" '
strfile = strfile & filename
size=uploadform("file").size
'÷ size
if formatnumber(size/1024)
> 5120 then '÷
size 5mb ̻϶
<%
response.end
else '÷
uploadform("file").saveas
strfile
end if
end if
set uploadform = nothing 'ε
ü Ҹ
set objmail = server.createobject("cdonts.newmail")
'newmail ü
with objmail
. from = fromaddr '
ּ
.to = toaddr '
ּ
.subject = subject '
.body = body '
if html = 1 then 'html
.bodyformat = cdobodyformathtml
.mailformat = cdomailformathtml
end if
if attach_count = 1
then '÷
.attachfile strfile,,cdoencodingbase64
' ÷
if html <> 1
then ' ÷ν bodyformat
Ӽ mailformat Ӽ html ؾ
.bodyformat = cdobodyformathtml
.mailformat = cdomailformathtml
end if
end if
.send '
end with
set objmail = nothing 'newmail
ü Ҹ
if attach_count = 1 then
set objfso = server.createobject("scripting.filesystemobject")
' ý ü
if objfso.fileexists(strfile) then '
objfso.deletefile(strfile) '
end if
set objfso = nothing 'ü
Ҹ
end if
%>
if formatnumber(size/1024) > 5120 then
%> <script language=javascript>
<!--
alert("÷ 5mb ϴ.");
history.back();
//--> </script>
κ formatnumber Լ ̿Ͽ ÷ ũⰡ 5mb ̻
â ִ κԴϴ.
*
formatnumber - Լ
formatnumber
Լ ڷ ȭ ȯմϴ.
,
num = 100.25
result = formatnumber(num/10, 2) '10.03 ȯ
ֵ ι° ڸ 2 ϸ Ҽ ڸ ȯ, 3
ϸ ڸ ȯմϴ.
with objmail
.from = fromaddr
.to = toaddr
.subject = subject
.body = body
.send
end with
with ؼ ϴ κԴϴ.
with ϸ ü ̸(⼱ objmail) ٽ ο ʰ
ü Ϸ ֽϴ.
, ü ٸ Ӽ Ϸ with Ӽ Ҵ繮
Ӵϴ. ( ó)
̷ ϸ ü Ӽ ϴ ü ϸ ˴ϴ.
if attach_count = 1 then
set objfso = server.createobject("scripting.filesystemobject")
if objfso.fileexists(strfile) then
objfso.deletefile(strfile)
end if
set objfso = nothing
end if