這是個的例子~
Email
<%@ Page Language=
<!DOCTYPE HTML PUBLIC
<HTML>
<HEAD>
<title>SendEmail</title>
<meta name=
<meta content=
<meta content=
<meta content=
<meta content=
</HEAD>
<body MS_POSITIONING=
<form id=
<asp:Label id=Label
>
Sending Email from ASP
</asp:Label>
<asp:TextBox id=txtFrom runat=
</asp:TextBox>
<asp:Label id=Label
From:
</asp:Label>
<asp:RequiredFieldValidator id=RequiredFieldValidator
ErrorMessage=
</asp:RequiredFieldValidator>
<asp:TextBox id=txtTo runat=
</asp:TextBox>
<asp:Label id=Label
>
To:
</asp:Label>
<asp:RequiredFieldValidator id=RequiredFieldValidator
ErrorMessage=
</asp:RequiredFieldValidator>
<asp:TextBox id=txtSubject runat=
</asp:TextBox>
<asp:Label id=Label
>
Subject:
</asp:Label>
<asp:RequiredFieldValidator id=RequiredFieldValidator
ErrorMessage=
</asp:RequiredFieldValidator>
<asp:TextBox id=txtMessage runat=
>
</asp:TextBox>
<asp:Label id=Label
>
Message:
</asp:Label>
<asp:RequiredFieldValidator id=RequiredFieldValidator
</asp:RequiredFieldValidator>
<asp:Button id=cmdSendEmail runat=
>
</asp:Button>
<asp:Label id=lblMessage runat=
Font
</asp:Label>
</form>
</body>
</HTML>
Email
Imports System
Public Class SendEmail
Private Sub cmdSendEmail_Click(ByVal sender As System
Dim objMail As New MailMessage()
objMail
objMail
objMail
objMail
objMail
SmtpMail
Me
End Sub
End Class
From:http://tw.wingwit.com/Article/program/net/201311/13600.html