欢迎光临
我们一直在努力

建站超值云服务器,限时71元/月

<%@ page language="vb" enablesessionstate="false" enableviewstate="false" trace="false" debug="false" strict="true" %>
<%@ import namespace="system.web.mail" %>
<script language="vb" runat=server>
sub page_load(sender as object, e as eventargs)
    

    if request.form("emailaddress") = "" then
        dim strresponse as string = "<h2>send email using asp.net formatted in html</h2>"
        lblmessage.text = strresponse
    else
        dim strresponse as string = "you just sent an email message formatted in html to:<br><h2>" & request("emailaddress") & "</h2>"
        lblmessage.text = strresponse
    end if
    
end sub
    
sub btn_click(sender as object, e as system.eventargs)

    if request.form("emailaddress") <> ""
        dim mail as new mailmessage
        mail.from = "youraddress@domain.com"
        mail.to = request.form("emailaddress")
        mail.subject = "message sent using asp.net and cdonts"
        mail.body = "html message sent from aspfree.com using asp.net and cdonts<br><a href=http://aspfree.com/aspnet/email.aspx>wonder how this is done?</a><br><br><a href=http://aspfree.com/aspnet/setupcdonts.aspx>wonder how to setup cdonts?</a>"
        mail.bodyformat = mailformat.html
    smtpmail.send(mail)
    end if
end sub

</script>
<html>
<head>
</head>
<body>
<h1 align="center">sending email via asp.net and cdonts..</h1>
<b><a href="/aspnet/setupcdonts.aspx">how do i setup my server to use cdonts?</a></b>
<br />
<br />
<a href="/allzips/emaildotnet.zip"><img src="http://aspfree.com/images/downloadcode.gif" border="0"></a>
<br />
<br />
<asp:label id="lblmessage" font-name="verdana" width="400px" borderstyle="solid" bordercolor="#cccccc" runat="server"/>

<form method="post" name="form1" runat="server" runat="server">
email address:<input type="text" name="emailaddress" size="30" value=""><br><br>
<input type="submit" id="btnsubmit" onserverclick="btn_click" value="sending email with asp.net" name="b1" runat="server" />
</form>
</body>
</html>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 »
分享到: 更多 (0)

相关推荐

  • 暂无文章