<!--#include file="articleconn.asp"-->
<html>

<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<title>发送文章到邮箱</title>
<link rel="stylesheet" href="style/001.css" type="text/css">
</head>

<body>
<%
dim email
dim founderr
dim con
dim rs,sql
fouunderr=false
dim errmsg
con="网思｜&copy;2000,All Right Servered，http://nethink.coc.cc"
email=trim(Request.Form("email"))
if IsValidEmail(email)=false then
   errmsg=errmsg+"<li>您的email有错误!</li>"
   founderr=true
end if
%>
<div align=center>
  <table border="0" cellspacing="0" width="85%" cellpadding="0" 
height="17" class="tableclass">
    
    <tr>
      <td width="100%" > 
        <%
if founderr=false then
dim  objCDOMail
set rs=server.createobject("adodb.recordset")
sql="select * from learning where articleid="&request("id")
rs.open sql,conn,1,1
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
objCDOMail.From =7th@china.com    
objCDOMail.To =email   
objCDOMail.Subject =rs("title")  
objCDOMail.Body ="文章标题："&rs("title")&chr(13)&chr(10)&"正文："&rs("content")&chr(13)&chr(10)&"欢迎继续使用百灵网论坛http://www.top80.net"&chr(13)&chr(10)&"Email：wu-2000@163.net"    
objCDOMail.Send
Set objCDOMail = Nothing
rs.close
set rs=nothing
%>
        <div align="center" style="width: 829; height: 49">
<p>文章发送成功，请再继续阅读本站其他文章；有什么问题请在论坛提出！</p>
          <p>感谢您的支持，这里的建设离不开您的意见和建议！ </p> 
        </div> 
<% 
response.write "</td></tr></table>" 
else%> 
        <p>&nbsp; <font color="#FF0000"><br> 
          Sorry， 您的信息不能正确发送，请再仔细检查以下的项目是否正确：</font>   
        <ul>
          <font color="#FF0000"> 
          <%response.write errmsg%>
          </font> 
        </ul>
      </td>  
    </tr>  
  </table>  
</div>  
<dd align="center">  
    <div align="center"><br>  
    </div>  
</form>  
<%  
end if  
%>  
  
</body>  
</html>  
<%  
function IsValidEmail(email)  
  
dim names, name, i, c  
  
'Check for valid syntax in an email address.  
  
IsValidEmail = true  
names = Split(email, "@")  
if UBound(names) <> 1 then  
   IsValidEmail = false  
   exit function  
end if  
for each name in names  
   if Len(name) <= 0 then  
     IsValidEmail = false  
     exit function  
   end if  
   for i = 1 to Len(name)  
     c = Lcase(Mid(name, i, 1))  
     if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then  
       IsValidEmail = false  
       exit function  
     end if  
   next  
   if Left(name, 1) = "." or Right(name, 1) = "." then  
      IsValidEmail = false  
      exit function  
   end if  
next  
if InStr(names(1), ".") <= 0 then  
   IsValidEmail = false  
   exit function  
end if  
i = Len(names(1)) - InStrRev(names(1), ".")  
if i <> 2 and i <> 3 then  
   IsValidEmail = false  
   exit function  
end if  
if InStr(email, "..") > 0 then  
   IsValidEmail = false  
end if  
  
end function  
%>  
  
