永发信息网

asp+jmail自动发送邮件

答案:1  悬赏:70  手机版
解决时间 2021-05-01 07:30

<%
  if UCase(Request.Form("Oper")) = "FINDPWD" then
   Dim rdsMember     '/创建会员账号访问对象/
   Dim sqlMember       '/创建SQL语句/
   Dim strMember    '/会员账号/
   Dim strPassword   '/管理密码/
   Dim strEmail
   Dim strContent
   Dim jmlSendEmail

   strMember = changechr(Request.Form("Member"))
            sjmail=IsObjInstalled("JMail.Message")
   set rdsMember = Server.CreateObject("ADODB.Recordset")
   sqlMember = "Select * From love_main Where username = '"& strMember &"'"
   rdsMember.Open sqlMember,Conn,1,1
   if not rdsMember.EOF then
    strPassWord = rdsMember("Password")
    strEmail = rdsMember("Email")
    strContent = "您在简爱的会员登陆密码为:"& strPassword &""
                If sjmail=false Then
                strMsg = "服务器不支持Jmail邮件发送组件,不能使用此功能!"
                else
    set jmlSendEmail = Server.CreateObject("JMAIL.Message")
    jmlSendEmail.Logging = True
    jmlSendEmail.Silent = True
    jmlSendEmail.Charset = "GB2312"
    jmlSendEmail.From ="chenke521xu@163.com"                             '/发件人E-Mail/
    jmlSendEmail.AddRecipient strEmail                               '/收件人E-Mail/
    jmlSendEmail.ContentType = "text/html"
    jmlSendEmail.Subject = "简爱会员登陆密码"             '/邮件的标题/
 
    jmlSendEmail.Body = strContent 
                                        '/文本格式/
    jmlSendEmail.Priority=1
    jmlSendEmail.MailServerUserName = "chenke521xu@163.com"
    jmlSendEmail.MailServerPassowrd = "chenke"
    
    jmlSendEmail.MailDomain ="stmp.163.com"                     '/发送邮件服务器SMTP Server/ 
    jmlSendEmail.Send("stmp.163.com")                              '/发送邮件服务器POP3 Server/
    jmlSendEmail.Close
    set jmlSendEmail = nothing
    
    strMsgTitle = "找回密码成功"
    strError = False
    strMsg = "找回密码成功,密码已发往您注册时填写的E-Mail:"&strEmail&",请注意查收..."
    strGoFile = "index.asp"
            end if
    Call ShowMessage()
   else
    Response.Write "<script>alert(""\您输入的会员帐号不存在,请重新输入!"");window.location='FindPwd.asp';</script>"
   end if
   rdsMember.Close
   set rdsMember = nothing
  else
  %>
   <script language="javascript">
   function FindPwdForm() {
    if (document.FindPwd.Member.value == "") {
     alert("\请输入您的会员帐号!");
     document.FindPwd.Member.focus();
    }
    else if ((document.FindPwd.Member.value).length<4) {
     alert("\会员帐号至少4位!");
     document.FindPwd.Member.focus();
    }
    else {
           return true;
       }
       return false;
   }
   </script>
          <table width="700" border="0" align="center" cellpadding="0" cellspacing="1">
          <form method="post" action="FindPwd.asp" name="FindPwd" OnSubmit="return FindPwdForm()">
          <input type="hidden" name="Oper" value="FindPwd">         
            <tr>
              <td width="100%" height="30" align="center">请输入您的会员帐号:&nbsp;
                <input type="text" name="Member" maxlength="15" class="ipt2">&nbsp;<input type="submit" name="Submit" value="查找密码" class="button"></td>
            </tr>
          </form>
          </table>
  <%end if%>

 

 

 

<%
function changechr(str)
    changechr=replace(replace(replace(replace(str,"<","&lt;"),">","&gt;"),chr(13),"<br>")," ","")
   changechr=replace(replace(replace(replace(changechr,"'",""),"and",""),"insert",""),"set","")
    changechr=replace(replace(replace(replace(changechr,"select",""),"update",""),"delete%20from",""),chr(34),"&quot;")
end function
Sub ShowMessage()
 if strMsgTitle = "" then strMsgTitle = "异常出错"
 if strMsg = "" then strMsg = "未知错误"
%>
  <br>
  <table border="0" width="70%" cellspacing="0" cellpadding="0" align="center">
 <tr>
   <td width="100%" bgcolor="#3986CE">
  <table border="0" width="100%" cellspacing="1">
    <tr>
      <td width="100%" align="center" bgcolor="#3986CE" height="30"><% = strMsgTitle%></td>
    </tr>
    <tr>
      <td width="100%" align="center" height="68" bgcolor="#FFFFFF" ><% = strMsg%></td>
    </tr>
          <tr>
            <td width="100%" align="center" height="25" ><input onclick="parent.location.href='Javascript:history.back()'" type="button" value="返 回" class="face" name="button1"></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  <br>
<%End Sub%>邮件发送不成功

最佳答案

你启动asp的服务器了吗?


我的可以发送。

我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
免兔怎么领养
玩魔兽世界屏幕卡 但是网速和延迟都不高。这
有车一族请进!
爱慕一个人的诗词知乎,形容迷茫 的诗词
上高县红太阳中英文幼儿园这个地址在什么地方
所谓的筋和韧带是指神经纤维吗?
为什么奔四的电脑装上SP3的系统机子反应很慢
车子违章两次或者以上的不仅扣分罚款还得学习
视频转换后图像变成竖着的了,怎么办?
QQ秀相册的真人秀保存不了?
手机CPU补焊一般要多少钱
安阳到盐城多少公里,盐城去洛阳火车站要多长
龙之谷 祭祀。牧师的加血问题
寻高手寂寞类网游小说
什么是卵巢嚷肿
推荐资讯
丝路英雄怎么交易啊?
我希望我的家人天天过的开心,幸福的用英语怎
登记完了不能上架,想重新开始登记,怎么做
德刚 2010年有什么新相声
希望被别人理解的句子,一句话心情签名表示思
中国青年志愿者的誓词是这样的:“我愿意成为
新能科技电源地址在哪,我要去那里办事
邓超和孙俪做过爱么
我忘记网址的几个英文,怎么搜网址呢?有什么
为什么法国队于黑人球员居多呢?
怎么做一个女人心目中的好男人呢
如何才能找到江苏省张家港市杨舍镇乘航河东路
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?