<%
'รับค่าที่ส่งมาเข้าตัวแปร
toto = request("to")
from = request("from")
subject = request("sub")
cc = request("cc")
message = request("message")
'เมื่อตัวแปร toto และ message ไม่เท่ากับค่าว่าง
If toto <> "" and message <> "" Then
If Instr(toto,"@") = 0 then
%>
<%
end if
If Instr(from,"@") = 0 then
%>
<%
end if
'สร้าง Object Mail
Set objMail = Server.CreateObject("CDONTS.NewMail")
'ใส่ค่าลงตัวแปร
objMail.To = toto
objMail.From = from
objMail.Subject = subject
objMail.Cc = cc
objMail.Body = message
'ทำการส่ง Mail
objMail.Send
Response.Write("
Send Mail Complete !
")
'เขียน Version ของ Mail ออกไปที่ Html
Response.Write("
This Server using version: "& objMail.Version &" of CDONTS