国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

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

2024-07-10 13:04:26
字體:
來源:轉載
供稿:網友
<%@ 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 = "[email protected]" & 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") & ".  " & _
                vbcrlf & vbcrlf & _
                "this email was sent to " & stremail & "."

            mymail.send(mymessage)

            frmemail.visible = false
            lblusermessage.text = "your message has been sent to " & stremail & "."
        end if
    end sub
</script>

<html>
<head>
<title>asp+ email sample</title>
</head>
<body>

<asp:label id="lblusermessage" text="enter your e-mail address:" runat="server" />
<form method="post" id="frmemail" runat="server">
    <asp:textbox id="txtemail" size="30" runat="server" />
    <asp:requiredfieldvalidator runat="server"
        id="validemailrequired" controltovalidate="txtemail"
        errormessage="please enter an email address."
        display="dynamic" />
    <asp:regularexpressionvalidator runat="server"
        id="validemailregexp" controltovalidate="txtemail"
        validationexpression="^[/w-][email protected][/w-]+/.(com|net|org|edu|mil)$"
        errormessage="please enter a valid email address."
        display="dynamic" />

    <asp:button id="btnsendmail" text="send mail!" onclick="btnsendmail_onclick" runat="server" />
</form>

</body>
</html>
-------------------------------------------
come from asp101.com

收集最實用的網頁特效代碼!

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 南宁市| 高阳县| 长海县| 深水埗区| 陆河县| 沭阳县| 保山市| 清新县| 游戏| 威信县| 宜兰市| 高尔夫| 巩留县| 屏东市| 二手房| 巴林左旗| 永丰县| 安溪县| 杭锦后旗| 盈江县| 金华市| 马尔康县| 营山县| 江华| 吉林省| 永昌县| 淮安市| 佳木斯市| 许昌县| 武安市| 河曲县| 沙湾县| 大渡口区| 衢州市| 无为县| 德州市| 阳东县| 天门市| 五常市| 昌宁县| 邹平县|