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

最新下载

Sending Email via ASP.NET and CDONTS[vs bate2 等级 中

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

<%@ 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 = "

Send Email using ASP.NET formatted in HTML

"
        lblMessage.Text = strResponse
    Else
        dim strResponse as string = "You just sent an email message formatted in HTML to:

" & request("EmailAddress") & "

"
        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")

网站留言

热门栏目