| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 913 人关注过本帖
标题:关于jmail,能发不能接收,请指点.
只看楼主 加入收藏
天龙
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2008-3-7
收藏
 问题点数:0 回复次数:7 
关于jmail,能发不能接收,请指点.
测试地址http://请大家帮帮忙!
原代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'=========================================================
' File: PE2006_JMail.asp(动易2006JMail发邮件服务器测试文件)
' Version:1.0
' Date: 2006-5-15
' Script Written  动易网络
' Copyright (C) 2006-2008 Powereasy Inc. All rights reserved.
' Web: http://www.
' Attention:注意参数设置
'=========================================================
Server.ScriptTimeOut=9999999
Response.Buffer = True

dim FoundErr, ErrMsg, Action
dim MailServerUserName, MailServerPassWord, MailDomain, MailServer
dim MailtoAddress, MailtoName, Subject, MailBody, FromName, MailFrom, Priority

FoundErr = False
ErrMsg = ""
Action = Trim(Request("action"))
ComeUrl = ""
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>动易2006JMail发邮件服务器测试文件</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2600.0" Name=GENERATOR>
<STYLE type=text/css>
a {text-decoration: none;} /* 链接无下划线,有为underline */
a:link {color: #000000;text-decoration: none;} /* 未访问的链接 */
a:visited {color: #000000;text-decoration: none;} /* 已访问的链接 */
a:hover {color: #ff6600;text-decoration: none;} /* 鼠标在链接上 */
a:active {color: #000000;text-decoration: none;} /* 点击激活链接 */
TD {
    FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: '宋体';LINE-HEIGHT: 150%;
}
BODY {
    FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: '宋体'
}
INPUT {
    FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: '宋体'
}
SELECT {
    FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: '宋体'
}
.title
{
    background:#0DB432;
    color: #ffffff;
    font-weight: normal;
}
.border
{
    border: 1px solid #0DB432;
}
.tdbg{
    background:#f0f0f0;
    line-height: 120%;
}
.tdbg1{
    background:#A3E2B1;
    line-height: 120%;
}
</STYLE>
</HEAD>

<BODY text=#000000 bgColor=#ffffff leftMargin=0 topMargin=0>
<br>
<%
Select Case Action
    Case "send"
        Call sendMail()
    Case Else
        Call Main()
End Select
If FoundErr = True Then
    Response.Write WriteErrMsg(ErrMsg, ComeUrl,"错误信息")
End If
Response.write"</BODY></HTML>"

sub main()

    If Not IsObjInstalled("JMail.Message") Then
        FoundErr=True
        ErrMsg = "服务器不支持JMail组件"
        Exit Sub
    End If      
        %>
    <form action="jmail.asp?Action=send" method=post>
      <table width="80%" class="border" border="0" cellspacing="1" cellpadding="4" align="center">
        <tr>  
          <td height="50" colspan="4" align="center" class="title">  
            <p><b>动易2006JMail发邮件测试</b></p>        </td>
        </tr>
        <tr>
          <td width='30%' class='tdbg1'><strong>SMTP服务器地址:</strong><br>
            用来发送邮件的SMTP服务器<br>
            如果你不清楚此参数含义,请联系你的空间商 </td>
          <td class='tdbg'>
            <input name='MailServer' type='text' id='MailServer' value='smtp.' size='40'>&nbsp;<FONT color=#ff0000>*</FONT>
          </td>
        </tr>
        <tr>
          <td width='30%' class='tdbg1'><strong>SMTP登录用户名:</strong><br>
            当你的服务器需要SMTP身份验证时还需设置此参数</td>
          <td class='tdbg'>
            <input name='MailServerUserName' type='text' id='MailServerUserName' value='aaa' size='40'>&nbsp;<FONT color=#ff0000>*</FONT>
          </td>
        </tr>
        <tr>
          <td width='30%' class='tdbg1'><strong>SMTP登录密码:</strong><br>
            当你的服务器需要SMTP身份验证时还需设置此参数 </td>
          <td class='tdbg'>
            <input name='MailServerPassWord' type='password' id='MailServerPassWord' value='bbb' size='40'>&nbsp;<FONT color=#ff0000>*</FONT>
          </td>
        </tr>
        <tr>
          <td width='30%' class='tdbg1'><strong>SMTP域名:</strong><br>
            如果用“name@”这样的用户名登录时,请指明
          <td class='tdbg'>
            <input name='MailDomain' type='text' id='MailDomain' value='' size='40'>&nbsp;<FONT color=#ff0000>*</FONT>
          </td>
        </tr>
        <tr>
          <td width="30%" class="tdbg1">您的姓名:</td>
          <td colspan="3" class="tdbg"><input name="name" type=text id="name" size=30>
          <FONT color=#ff0000>*</FONT></td>
        </tr>
        <tr>
          <td width="30%" class="tdbg1">您的E-mail:</td>
          <td colspan="3" class="tdbg"><input name="email" type=text id="email" value="aaa@ size=30>
          <FONT color=#ff0000>*</FONT></td>
        </tr>
        <tr>
          <td width="30%" class="tdbg1">收件人姓名:</td>
          <td colspan="3" class="tdbg"><input name="toname" type=text id="toname" size=30>
          <FONT color=#ff0000>*</FONT></td>
        </tr>
        <tr>
          <td width="30%" class="tdbg1">收件人Email:</td>
          <td colspan="3" class="tdbg"><input name="toemail" type="text" id="toemail" size="30" maxlength="100">
          <FONT color=#ff0000>*</FONT></td>
        </tr>
        <tr>
          <td width="30%" class="tdbg1">邮件标题:</td>
          <td colspan="3" class="tdbg"><input type=text name="topic" size=30>
          <FONT color=#ff0000>*</FONT></td>
        </tr>
        <tr>
          <td width="30%" class="tdbg1">邮件内容:</td>
          <td colspan="3" class="tdbg"><textarea name="body" cols=70 rows=6 id="body"></textarea>
          <FONT color=#ff0000>*</FONT></td>
        </tr>
        <tr>
          <td width="30%" class="tdbg"></td>
          <td height=20 colspan="3" class="tdbg">
            <input type="Submit" value="发送邮件" name="Submit">
    &nbsp;
            <input type="reset" name="Clear" value="重新填写">
          </td>
        </tr>
      </table>
</form>
    <%
End Sub

Sub sendMail()
    MailServer = trim(Request("MailServer")) 'SMTP服务器地址:smtp., 请修改
    MailServerUserName = trim(Request("MailServerUserName")) 'SMTP登录用户名:nxyc163@, 请修改
    MailServerPassWord = trim(Request("MailServerPassWord")) 'SMTP登录密码:*****, 请修改,注意大小写
    MailDomain = trim(Request("MailDomain")) 'SMTP域名:, 请修改

    FromName = trim(Request("name")) '发件人名字
    MailFrom = trim(Request("email")) '发件人邮箱
    MailtoName = trim(Request("toname")) '发件人名字
    MailtoAddress=trim(Request("toemail")) '收件人邮箱
    Subject = trim(Request("topic"))
    MailBody = trim(Request("body"))
    Priority=1
    If FromName="" or MailFrom="" or MailtoName="" or MailtoAddress="" or Subject="" or MailBody="" then
        FoundErr = True
        ErrMsg = "请填写完整每一项信息!"
        Exit Sub
    End If
    ErrMsg = JSendMail()
    If ErrMsg<>"" Then
        FoundErr = True
        Exit Sub
    Else
        Response.Write WriteErrMsg("", ComeUrl,"成功信息")
    End If
End Sub

Function JSendMail_2006()
    'On Error Resume Next
    JSendMail = ""
    Dim JMail,tempMessage
    Set JMail = Server.CreateObject("JMail.Message")
    JMail.Charset = "gb2312"        '邮件编码
    JMail.silent = True
    JMail.ContentType = "text/html"     '邮件正文格式
    'JMail.ServerAddress=MailServer     '用来发送邮件的SMTP服务器
    '如果服务器需要SMTP身份验证则还需指定以下参数
    JMail.MailServerUserName = MailServerUserName    '登录用户名
    JMail.MailServerPassWord = MailServerPassWord        '登录密码
    JMail.MailDomain = MailDomain       '域名(如果用“name@”这样的用户名登录时,请指明
    JMail.AddRecipient MailtoAddress, MailtoName    '收信人
    JMail.Subject = Subject       '主题
    JMail.HtmlBody = MailBody     '邮件正文(HTML格式)
    JMail.Body = MailBody        '邮件正文(纯文本格式)
    JMail.FromName = FromName       '发信人姓名
    JMail.From = MailFrom         '发信人Email
    JMail.Priority = Priority            '邮件等级,1为加急,3为普通,5为低级
    JMail.Send (MailServer)
    tempMessage = JMail.ErrorMessage
    JMail.Close
    Set JMail = Nothing
    If tempMessage<>"" then
        FoundErr = True
        JSendMail = tempMessage
    end if
    Set JMail = Nothing
End Function

Private Function JSendMail()
    On Error Resume Next
    Dim JMail
    Set JMail = Server.CreateObject("JMail.Message")
    JMail.Charset = "gb2312"        '邮件编码
    JMail.silent = True
    JMail.ContentType = "text/html"     '邮件正文格式
    'JMail.ServerAddress=MailServer     '用来发送邮件的SMTP服务器
    '如果服务器需要SMTP身份验证则还需指定以下参数
    JMail.MailServerUserName = MailServerUserName    '登录用户名
    JMail.MailServerPassWord = MailServerPassWord        '登录密码
    JMail.MailDomain = MailDomain       '域名(如果用“name@”这样的用户名登录时,请指明
    JMail.AddRecipient MailtoAddress, MailtoName    '收信人
    JMail.Subject = Subject       '主题
    JMail.HMTLBody = MailBody     '邮件正文(HTML格式)
    JMail.Body = MailBody        '邮件正文(纯文本格式)
    JMail.FromName = FromName       '发信人姓名
    JMail.From = MailFrom         '发信人Email
    JMail.Priority = Priority            '邮件等级,1为加急,3为普通,5为低级
    JMail.Send (MailServer)
    JSendMail = JMail.ErrorMessage
    JMail.Close
    Set JMail = Nothing
    JSendMail = ""
End Function

Function IsObjInstalled(strClassString)
    On Error Resume Next
    IsObjInstalled = False
    Err = 0
    Dim xTestObj
    Set xTestObj = CreateObject(strClassString)
    If Err.Number = 0 Then IsObjInstalled = True
    Set xTestObj = Nothing
    Err = 0
End Function


Function WriteErrMsg(sMsg, sComeUrl,Massages)
    Dim strMsg
    strMsg = strMsg & "<html><head><title>"&Massages&"</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'>" & vbCrLf
    strMsg = strMsg & "</head><body><br><br>" & vbCrLf
    strMsg = strMsg & "<table cellpadding=2 cellspacing=1 border=0 width=400 class='border' align=center>" & vbCrLf
    strMsg = strMsg & "  <tr align='center' class='title'><td height='22'><strong>"&Massages&"</strong></td></tr>" & vbCrLf
    if FoundErr=True Then
        strMsg = strMsg & "  <tr class='tdbg'><td height='100' valign='top'><b>产生错误的可能原因:</b>" & sMsg & "</td></tr>" & vbCrLf
    Else
        strMsg = strMsg & "  <tr class='tdbg'><td height='100' valign='top'><br><b>恭喜,成功用JMail发送邮件!</b>" & sMsg & "</td></tr>" & vbCrLf
    End If
    strMsg = strMsg & "  <tr align='center' class='tdbg'><td>"
    If sComeUrl <> "" Then
        strMsg = strMsg & "<a href='javascript:history.go(-1)'>&lt;&lt; 返回上一页</a>"
    Else
        strMsg = strMsg & "<a href='javascript:window.close();'>【关闭】</a>"
    End If
    strMsg = strMsg & "</td></tr>" & vbCrLf
    strMsg = strMsg & "</table>" & vbCrLf
    strMsg = strMsg & "</body></html>" & vbCrLf
    WriteErrMsg = strMsg
End Function
%>
搜索更多相关主题的帖子: jmail 服务器 CODEPAGE 
2008-03-13 10:48
天龙
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2008-3-7
收藏
得分:0 
问题追加.
我是用 ilylkilyhy@给ilylk@发邮件,能成功发送,ilylk@收不到邮件
2008-03-13 10:52
天龙
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2008-3-7
收藏
得分:0 
有没有高手帮帮忙啊
有没有高手帮帮忙啊
2008-03-13 13:02
天龙
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2008-3-7
收藏
得分:0 
难道真的没有人帮我解决吗?
难道真的没有人帮我解决吗?
2008-03-14 11:32
a48567653
Rank: 1
等 级:新手上路
帖 子:45
专家分:0
注 册:2008-2-16
收藏
得分:0 
收不到怎么能说成功呢,我也正研究这个呢,不懂
2008-03-14 12:34
天龙
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2008-3-7
收藏
得分:0 
高手帮帮忙啊
高手帮帮忙啊,谢谢了
2008-03-15 11:28
madpbpl
Rank: 4
等 级:贵宾
威 望:11
帖 子:2876
专家分:244
注 册:2007-4-5
收藏
得分:0 
有没有老一点的邮箱,最好是几年前申请的,貌似近期申请的邮箱不行
2008-03-15 12:59
天龙
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2008-3-7
收藏
得分:0 
我的申请了快一年了啊
公司是企业邮箱,也不能收到
2008-03-15 13:10
快速回复:关于jmail,能发不能接收,请指点.
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.039748 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved