一聚教程网:一个值得你收藏的教程网站

最新下载

.net beta2 操作email的例子(转)

时间:2008-01-12 00:00:00 编辑:简简单单 来源:转载

<%@ Page Language="VB" ClientTarget="downlevel" %>
<%@ Import Namespace="System.Web.Mail" %>
<script language="VB" runat="server">
    Sub btnSendMail_OnClick(Source As Object, E As EventArgs)
        Dim myMessage As New MailMessage
        Dim myMail    As New SmtpMail
        Dim strEmail    As String
        If Page.IsValid() Then
       strEmail = txtEmail.Text
       myMessage.From = "webmaster@" & Request.ServerVariables("SERVER_NAME")
       myMessage.To = strEmail
       myMessage.Subject = "E-mail Sample from ASP 101!"
       myMessage.Body = "This message was sent from sample code by " & _
           "http://www.asp101.com.    It is used to show people how " & _
           "to send e-mail from an ASP+ page.    This mail was sent " & _
           "from " & Request.ServerVariables("SERVER_NAME") & ".    " & _

网站留言

热门栏目