<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../conn/nosql.asp"-->
<!--#include file="../../conn/config.asp"-->
<!--#include file="../../conn/md5.asp"-->
<!--#include file="../../conn/page.asp"-->
<!--#include file="../count.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
<%
if isChkInteger(request("web_id")) then
web_id=request("web_id")
else
Response.Redirect ("../../index.asp")
end if
if request("action")="send" then
myname=nosql(request("myname"))
myemail=nosql(request("myemail"))
content=nosql(request("content"))

topic="我是"&myname&",有事找你！" ' 信件主题
mailbody=content ' 信件内容

ToEmail1=nosql(request("ToEmail1"))
ToEmail2=nosql(request("ToEmail2"))
ToEmail3=nosql(request("ToEmail3"))
ToEmail4=nosql(request("ToEmail4"))
ToEmail5=nosql(request("ToEmail5"))
ToEmail6=nosql(request("ToEmail6"))
ToEmail7=nosql(request("ToEmail7"))
ToEmail8=nosql(request("ToEmail8"))

if IsValidEmail(ToEmail1)=true then sendjmail2 ToEmail1,topic,mailbody
if IsValidEmail(ToEmail2)=true then sendjmail2 ToEmail2,topic,mailbody
if IsValidEmail(ToEmail3)=true then sendjmail2 ToEmail3,topic,mailbody
if IsValidEmail(ToEmail4)=true then sendjmail2 ToEmail4,topic,mailbody
if IsValidEmail(ToEmail5)=true then sendjmail2 ToEmail5,topic,mailbody
if IsValidEmail(ToEmail6)=true then sendjmail2 ToEmail6,topic,mailbody
if IsValidEmail(ToEmail7)=true then sendjmail2 ToEmail7,topic,mailbody
if IsValidEmail(ToEmail8)=true then sendjmail2 ToEmail8,topic,mailbody

'If SendJmail(email,Topic,MailBody) = 1 Then
'	Response.Write "<br/><br/>资料成功发送到您的注册邮箱！"
'Else
'	Response.Write "<br/><br/>未正确设置邮件发送或您填写的邮件地址有误，资料发送失败！"
'End If
response.write "<script language='javascript'>"
response.write "alert('资料成功发送到您朋友的邮箱！');"
response.write"this.location.href='sendfriend.asp?web_id="&request("web_id")&"';</SCRIPT>"
response.end

Function SendJmail2(Email,Topic,MailBody)

	
Dim JMail
		on error resume next
	 Set jmail = Server.CreateObject("JMAIL.Message")   '建立发送邮件的对象
     jmail.silent = true    '屏蔽例外错误，返回FALSE跟TRUE两值j
     mail.logging = true   '启用邮件日志
     jmail.Charset = "GB2312"     '邮件的文字编码为国标
     jmail.ContentType = "text/html"    '邮件的格式为HTML格式
     jmail.AddRecipient Email     '邮件收件人的地址
     jmail.From = fmail   '发件人的E-MAIL地址
     jmail.MailServerUserName = umail     '登录邮件服务器所需的用户名
     jmail.MailServerPassword = pmail     '登录邮件服务器所需的密码
     jmail.Subject = Topic    '邮件的标题 
     jmail.Body = MailBody      '邮件的内容
     jmail.Prority = 1      '邮件的紧急程序，1 为最快，5 为最慢， 3 为默认值
     jmail.Send(smail)     '执行邮件发送（通过邮件服务器地址）
     jmail.Close()   '关闭对象
	Set JMail = Nothing

End Function

else
if isChkInteger(request("web_id")) then
web_id=request("web_id")
else
response.write "<script language='javascript'>"
response.write "alert('对不起，非法操作！');"
response.write"window.close()</SCRIPT>"
response.end
end if
if session("id")<>"" then
set rs=conn.execute("select name,email from snsn_user where id="&session("id")&"")
if rs.eof or rs.bof then
response.write""
else
myname=rs("name")
myemail=rs("email")
end if

rs.close
set conn=nothing
end if
%>
<SCRIPT language=javascript>
//-->
function trim(inputString) {
	   
              if (typeof inputString != "string") { return inputString; }
              var retValue = inputString;
              var ch = retValue.substring(0, 1);
              while (ch == " ") { 
	          //检查字符串开始部分的空格
                  retValue = retValue.substring(1, retValue.length);
                  ch = retValue.substring(0, 1);
              }
              ch = retValue.substring(retValue.length-1, retValue.length);
              while (ch == " ") {
                 //检查字符串结束部分的空格
                 retValue = retValue.substring(0, retValue.length-1);
                 ch = retValue.substring(retValue.length-1, retValue.length);
              }
              while (retValue.indexOf("  ") != -1) { 
	         //将文字中间多个相连的空格变为一个空格
                 retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
              }
              return retValue;
           } 

//--> 


function Form1_onsubmit()
 {
if (trim(document.Form1.myName.value) =="") 
{ 
alert("请输入您的姓名"); 
document.Form1.myName.focus(); 
return (false); 
} 
if (trim(document.Form1.myEmail.value) =="")
{
alert("请输入您的Email地址");
document.Form1.myEmail.focus();
document.Form1.myEmail.select();
return false;
}
var str1 = document.Form1.myEmail.value
if(str1.indexOf("@") == -1 || str1.indexOf(".") == -1){ 
alert("您的Email格式不正确,请重新填写！"); 
document.Form1.myEmail.focus();
document.Form1.myEmail.select();
return false; 
} 
if (trim(document.Form1.ToEmail1.value) =="")
{
alert("请输入您的朋友的Email地址");
document.Form1.ToEmail1.focus();
document.Form1.ToEmail1.select();
return false;
}
var str1 = document.Form1.ToEmail1.value
if(str1.indexOf("@") == -1 || str1.indexOf(".") == -1){ 
alert("您的朋友的Email地址,请重新填写！"); 
document.Form1.ToEmail1.focus();
document.Form1.ToEmail1.select();
return false; 
} 
if (trim(document.Form1.content.value) =="") 
{ 
alert("请输入内容！"); 
document.Form1.content.focus(); 
return (false); 
} 

}
</SCRIPT>

<style type="text/css">
<!--
.tmpstr21 {word-break:break-all}
-->
</style>
<FORM name="Form1" action="?action=send&web_id=<%=request("web_id")%>" method=post onsubmit="return Form1_onsubmit();">
  <table width="420"  border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="1" height="1"></td>
      <td height="1" colspan="2" bgcolor="#CCCCCC"></td>
      <td width="1" height="1"></td>
    </tr>
    <tr>
      <td width="1" bgcolor="#CCCCCC"></td>
      <td width="30" bgcolor="#F1F1F1"><div align="center"><span class="M"><IMG 
                              src="img/vote_u.gif" 
                              name=image1754891 width="15" height="15" border=0></span></div></td>
      <td height="25" bgcolor="#F1F1F1"><span class="M"><FONT 
                              color=#000000><a href="web.asp?web_id=<%=web_id%>"><U><%=home%></U></a></FONT> <FONT 
                              color=#000000> -> <u>把这条信息推荐给你的好友</u></FONT></span></td>
      <td width="1" bgcolor="#CCCCCC"></td>
    </tr>
    <tr>
      <td width="1" height="1"></td>
      <td height="1" colspan="2" bgcolor="#CCCCCC"></td>
      <td width="1" height="1"></td>
    </tr>
  </table><br>
  <TABLE width="420" 
        border=0 align="center" cellPadding=0 cellSpacing=1 bgcolor="efefef">
    <TBODY>
      <TR bgcolor="#FFFFFF">
        <TD height="23" bgcolor="#FFFFFF">&nbsp;&nbsp; 您的姓名：<strong>
        <input name="myName" class="wenbenkuang" value="<%=myname%>" size=30 maxlength=80>
        <font 
            color=red>*</font></strong></TD>
      </TR>
      <TR bgcolor="#FFFFFF">
        <TD height="23" bgcolor="#FFFFFF">&nbsp;&nbsp; 您的Email： <strong>
          <INPUT 
            name=myEmail class="wenbenkuang" value="<%=myemail%>" size=30 maxLength=80>
        <FONT color=red>*</FONT></strong></TD>
      </TR>
      <TR bgcolor="#FFFFFF">
        <TD height="23" bgcolor="#FFFFFF">&nbsp;&nbsp; 您的朋友的Email地址(可以填写八个)：  </TD>
      </TR>
      <TR bgcolor="#FFFFFF">
        <TD height="23" bgcolor="#FFFFFF">&nbsp;&nbsp; 1 : <strong>
          <INPUT name=ToEmail1 class="wenbenkuang" size=30 maxLength=80>
        <FONT 
            color=red>*</FONT></strong></TD>
      </TR>
      <TR bgcolor="#FFFFFF">
        <TD height="23" bgcolor="#FFFFFF">&nbsp;&nbsp; 2 : <strong>
          <INPUT name=ToEmail2 class="wenbenkuang" size=30 maxLength=80>
        </strong></TD>
      </TR>
      <TR bgcolor="#FFFFFF">
        <TD height="23" bgcolor="#FFFFFF">&nbsp;&nbsp; 3 : <strong>
          <INPUT name=ToEmail3 class="wenbenkuang" size=30 maxLength=80>
        </strong></TD>
      </TR>
      <TR bgcolor="#FFFFFF">
        <TD height="23" bgcolor="#FFFFFF">&nbsp;&nbsp; 4 : <strong>
          <INPUT name=ToEmail4 class="wenbenkuang" size=30 maxLength=80>
        </strong></TD>
      </TR>
      <TR bgcolor="#FFFFFF">
        <TD height="23" bgcolor="#FFFFFF">&nbsp;&nbsp; 5 : <strong>
          <INPUT name=ToEmail5 class="wenbenkuang" size=30 maxLength=80>
        </strong></TD>
      </TR>
      <TR bgcolor="#FFFFFF">
        <TD height="23" bgcolor="#FFFFFF">&nbsp;&nbsp; 6 : <strong>
          <INPUT name=ToEmail6 class="wenbenkuang" size=30 maxLength=80>
        </strong></TD>
      </TR>
      <TR bgcolor="#FFFFFF">
        <TD height="23" bgcolor="#FFFFFF">&nbsp;&nbsp; 7 : <strong>
          <INPUT name=ToEmail7 class="wenbenkuang" size=30 maxLength=80>
        </strong></TD>
      </TR>
      <TR bgcolor="#FFFFFF">
        <TD height="23" bgcolor="#FFFFFF">&nbsp;&nbsp; 8 : <strong>
          <INPUT name=ToEmail8 class="wenbenkuang" size=30 maxLength=80>
        </strong></TD>
      </TR>
      <TR bgcolor="#FFFFFF">
        <TD height="23" bgcolor="#FFFFFF"><strong>
          &nbsp;&nbsp;
<TEXTAREA name=content cols=60 rows=8 class="wenbenkuang">老朋友你好，我是<%=myname%>，我在<%=webname%>[<%=weburl%>]上发现一个不错的个人主页，也许你会感兴趣，有时间去看一下也申请一个？

详细信息请查看:
<%=WebUrl%>home/index.asp</TEXTAREA>
        <FONT color=red>*</FONT> </strong></TD>
      </TR>
      <TR bgcolor="#FFFFFF">
        <TD height="25" bgcolor="#FFFFFF"><strong>
          &nbsp;&nbsp;
<input name=go type=image  src=img/tj.gif alt=GO align=absMiddle width="32" height="17"  border=0>
        </strong></TD>
      </TR>
    </TBODY>
  </TABLE>
</form>
<%end if%>