01.
<%@ Import
Namespace
=
"System.Web.Mail"
%>
02.
<%@ Page Language=
"VB"
%>
03.
<script runat=
"server"
>
04.
Sub
Page_Load(sender
As
Object
, e
As
EventArgs)
05.
Dim
myMail
As
New
MailMessage()
06.
07.
myMail.
To
=
"thaicreate-admin@hotmail.com"
08.
myMail.From =
"webmaster@thaicreate.com"
09.
myMail.Subject =
"Test sending mail"
10.
11.
myMail.BodyFormat = MailFormat.Text
12.
myMail.Body =
"My Body & Description"
13.
14.
SmtpMail.Send(myMail)
15.
myMail =
Nothing
16.
17.
Me
.lblText.Text =
"Mail Sending."
18.
End
Sub
19.
20.
</script>
21.
<html>
22.
<head>
23.
<title>ThaiCreate.Com ASP.NET - Send Mail</title>
24.
</head>
25.
<body>
26.
<form id=
"form1"
runat=
"server"
>
27.
<asp:Label id=
"lblText"
runat=
"server"
></asp:Label>
28.
</form>
29.
</body>
30.
</html>