ASP advanced article online Management update (VI)

Source: Internet
Author: User
ASP advanced article online Management Update--article forwarding email
Author: Beach Boy
This is one of the main features of this program. In ASP, you can make use of NT SMTP to send Mail Online, but you must confirm that your system has installed the Windows NT Opton PACK SMTP SERVICE, in this article management system is through it to achieve the online transmission of articles, It is only necessary to call the contents of the database and send it to the mailbox.
Here is a description of their implementation of the process, the following is the Mail Send program (sendemail.asp) The specific code and comments:
"Insert Open database Connection file
<!--#include file= "conn.asp"-->
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> send articles to email </title>
<body>
<%
"Define related variables
Dim email
Dim Founderr
Dim con
Dim rs,sql
Fouunderr=false
Dim errmsg
Email=trim (Request.Form ("email"))
"Using predefined IsValidEmail functions to determine if email writing is wrong
If IsValidEmail (email) =false Then
errmsg=errmsg+ "<li> your email has errors!</li>"
Founderr=true
End If
%>
<div align=center>
<table border= "0" cellspacing= "0" width= "85%" cellpadding= "0"
height= "class=" "Tableclass" >
<tr>
&LT;TD width= "100%" >
<%
If Founderr=false Then
Dim objcdomail
"Determines what you need to open the recordset article by the ID value returned from list.asp
Set Rs=server.createobject ("Adodb.recordset")
Sql= "SELECT * from article where articleid=" &request ("id")
Rs.Open sql,conn,1,1
"Use Cdonts.newmail to send mail
Set Objcdomail = Server.CreateObject ("CDONTS. NewMail ")
"Here from is the address of the sender, to the address of the addressee, here for the email returned from the list.asp file
Objcdomail.from = "Wodeail@etang.com"
Objcdomail.to =email
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.