欢迎光临
我们一直在努力

如何在ASP+中发送邮件

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

this article features how to send email from an asp+ page. using email from an asp+ page has many uses

(notify of errors, inform people about a a subject. etc..). this code sample sends a formatted html

message to the email address entered. enjoy this free code!

here is the code

page 1. the input form

<html>

<head>

</head>

<body>

<form method="post" name="form1" action="emailhtml2.aspx">

email address:<input type="text" name="emailaddress" size="30" value="youremail@address.com"><br><br>

<input type="submit" value="send your friend an email using asp+" name="b1">

</form>

</body>

</html>

page 2. sends the email code

<%@ import namespace="system.web.util" %>

<script language="vb" runat=server>

sub page_load(sender as object, e as eventargs)

dim mymessage as new mailmessage

mymessage.to = request.form("emailaddress")

mymessage.from = "webmaster"

mymessage.subject = "this is message is from aspfree using asp+"

note:we added the bodyformat to show how to send

formatted html remove this line and all the html code in

message. the email will send as regular text

mymessage.bodyformat = mailformat.html

mymessage.body = "<html><body><h1>you received this email from <a

href=http://aspfree.com>aspfree.com</a> using asp+!</h1></body></html>"

smtpmail.send(mymessage)

end sub

</script>

<html>

<head>

<title>email formatted html message with asp+</title>

</head>

<body>

you just sent an email message formatted in html to:<br>

<h1><% response.write(request.form("emailaddress")) %></h1>

</body>

</html>

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