<body><b>Send password of Email confirm system</b>
<form method=post action=default.asp>
Name: <input type=text name=name>
E-mail: <input type=text name=email><br>
Confirm: <input type=checkbox name=toconfirm value=yes>
<input type=submit>
</form>
<%
dim name, email
name = request.form("name")
email = request.form("email")
toconfirm = request.form("toconfirm")
if toconfirm = "yes" then
if len(name) > 2 and len(email) > 5 then
randomize
session("passwd") = int(rnd*99999)+1
set mail = server.createObject("Persits.MailSender")
mail.Host = "mail.loxinfo.co.th"
mail.From = "testemailconfirm@thaiabc.com"
mail.AddAddress email
mail.Subject = "Registration bot from perlphpasp.com"
bodymsg = "Your registration PASSWD is: " & session("passwd") & chr(10)
bodymsg = bodymsg + "Have a good day"
mail.Body = bodymsg
On Error Resume Next
mail.Send
if Err <> 0 then
ErrMsg = "เกิดข้อผิดพลาด : " & Err.Description
else
ErrMsg = "ส่งรหัสผ่านไปให้ท่าน ทาง e-mail<BR>"
ErrMsg = ErrMsg + "ให้กลับมากรอกรหัสผ่านด้านล่าง เพื่อตรวจสอบ"
end If
set mail = nothing
response.write(ErrMsg)
else
response.write("ส่ง password ให้ท่านไม่สำเร็จ .. มีข้อผิดพลาด")
end if
end if
%>
<hr>
<b>Test password here:<b><br>
<form method=post action=checkpass.asp>
Password: <input type=text name=passwd>
<input type=submit>
</form><a href=sendmail.asp>sendmail.asp</a>
</body>
จำนวน : 46 บรรทัด