| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1147 人关注过本帖
标题:ASP点击按钮自动发送固定邮件到固定邮箱如何实现
只看楼主 加入收藏
jiazehua
Rank: 1
来 自:大连
等 级:新手上路
帖 子:77
专家分:0
注 册:2010-8-15
结帖率:58.82%
收藏
已结贴  问题点数:40 回复次数:3 
ASP点击按钮自动发送固定邮件到固定邮箱如何实现
我又来求助了-ASP点击按钮自动发送固定邮件到固定邮箱如何实现
我的FTP支持JMAIL,但是我百度JMAIL全是一堆代码,基本是这样的:<%   xxx……%>
好多种也不知道到底哪个是对的,就算知道是对的了也不知道怎么用……
我把我网站的需要添加的页面发了上来
想求大家帮帮忙,小弟技术太差了,这个又急用,只好来求助
想实现点击预订按钮后自动发送“一个新预订”之类的邮件到我的邮箱
谢谢了拜托了!
hotel-booking.zip (4.25 KB)
搜索更多相关主题的帖子: 我的邮箱 百度 
2010-12-07 13:47
jiazehua
Rank: 1
来 自:大连
等 级:新手上路
帖 子:77
专家分:0
注 册:2010-8-15
收藏
得分:0 
自己顶一下……一直在刷新,一直在等……无奈啊

巫术时代-个人博客-[url]www.[/url]
2010-12-07 14:56
jiazehua
Rank: 1
来 自:大连
等 级:新手上路
帖 子:77
专家分:0
注 册:2010-8-15
收藏
得分:0 
<%
rem 创建一个JMAIL对象
Set jmail = Server.CreateObject("JMAIL.SMTPMail")
rem JMAIL不会抛出例外错误,返回的值为FALSE跟TRUE
jmail.silent = true
rem 启用使用日志
jmail.logging = true
rem 邮件文字的代码为简体中文
jmail.Charset = "GB2312"
rem 邮件的格式为HTML的
jmail.ContentType = "text/html"
rem 发送邮件的服务器
jmail.ServerAddress = "Server Address"
rem 邮件的收件人
jmail.AddRecipient Email
rem 邮件发送者的姓名
jmail.SenderName = "SenderName"
rem 邮件发送者的邮件地址
jmail.Sender = "Email Address"
rem 邮件的紧急程序,1 为最快,5 为最慢, 3 为默认值
jmail.Priority = 1
rem 邮件的标题
jmail.Subject = "Mail Subject"
rem 邮件的内容
jmail.Body = "Mail Body"
rem 密件收件人的地址
jmail.AddRecipientBCC Email
rem 邮件抄送者的地址
jmail.AddRecipientCC Email
rem 执行邮件发送
jmail.Execute()
rem 关闭邮件对象
jmail.Close
%>
这个要怎么用啊

巫术时代-个人博客-[url]www.[/url]
2010-12-07 14:57
dzt0001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:5
帖 子:1281
专家分:4998
注 册:2005-10-12
收藏
得分:40 
我以前做过Jmail发邮件的例子,不过找不到了,下面是从百度知道上复制来的。
你需要有一个自己邮箱用来做发件人,并知道这个邮箱的SMTP发信服务器的地址和端口
下面代码中的   JMail.MailServerusername、JMail.MailServerPassword 要修改成你的邮箱,可能还有地方要改改,你先看看吧。

 
下面的是2个页面。
mess.thml页面:
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>..::驶向天边-网页设计-::.. jmail提交邮箱代码测试</title>
<link rel="stylesheet" type="text/css" href="http://www.
<style type="text/css">
<!--
body,td,th {
 font-size: 12px;
 color: #20707d;
 line-height:22px;
 font-family:Verdana, Arial, Helvetica, sans-serif;
}
body {
 margin-left: 0px;
 margin-top: 0px;
 margin-right: 0px;
 margin-bottom: 0px;
 background:url(image/bg.jpg);
 background-position:center;
}
*{ margin:0; padding:0; border:0;}
html,body { height:100%;}
a:link {
 color: #20707d;
 text-decoration:none
}
a:visited {
 color: #20707d;
 text-decoration:none
}
a:hover {
 color: #2F99D2;
 text-decoration:none
}
a:active {
 color: #20707d;
 text-decoration:none
}
.top{margin:0 auto; width:800px;background:#FFFFFF; height:100%;}
.logo{margin:0px 5px 0px 5px; background: url(image/MAIN_04.gif) repeat-x; height:87px; width:790;}
.logoleft{float:left; height:87px;}
.logoright{float:right;text-align:right; padding-right:10px;}
.searchinput{border:medium none; background-color:transparent; font-family:Verdana, Arial, Helvetica, sans-serif; width:152px; height:27px; font-size:14px; line-height:28px; color:#20707d;}
.pagediv{margin:0px 5px 0px 5px; height:100%}
.pagemenu{ width:227px; height:100%; float:left; height:100%;}
.pagemenu0{ float:left; width:7px;}
.pagemenu1{float:left; width:556px;background-color:#FFFFFF}
.menuleft{padding-left:30px;}
.foot{height:30px; background:#20707d;width:790px;margin:0px 5px 0px 5px; color: #EEFBFF; text-align: right;}
.footdiv{height:30px; background:#fff; width:790px;}
.content{width:530px;padding:0px 10px 0px 10px; text-align: left;}
.title{width:530px;padding:10px 10px 0px 10px;text-align:right; font-family:Arial, Helvetica, sans-serif;}
.gcimg{float:left; width:33%; text-align:center; height:120px; overflow:hidden; margin:0 auto;}
.input3{border:1px #CCCCCC solid; font-family: Verdana, Arial, Helvetica, sans-serif;}
.button{border:1px #CCCCCC solid; font-size:12px; background: #E8F4F4; color: #006666; font-family:Verdana, Arial, Helvetica, sans-serif; height:20px; line-height:20px;}
.ListTitle{border-bottom:1px #5FA5D8 dashed;}
.left{padding-left:10px;}
.gctxt{float:left; width:33%; text-align:center;margin:0 auto;}
.subbg{ background:url(image/MAIN_25.gif) no-repeat center; height:191px; width:556px;}
-->
</style>
</head>

<body>
 <script language="JavaScript" type="text/javascript">
function isEmail(vEMail)
{
 var regInvalid=/(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
 var regValid=/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
 return (!regInvalid.test(vEMail)&&reg;Valid.test(vEMail));
}
function check()
{

if ((document.form1.sendemail.value)=="")
{
window.alert ("请输入发件邮箱!");
document.form1.sendemail.select();
document.form1.sendemail.focus();
return false;
}

if ((document.form1.title.value)=="")
{
window.alert ("请输入相关主题!");
document.form1.title.select();
document.form1.title.focus();
return false;
}
if ((document.form1.conten.value)=="")
{
window.alert ("请输入相关描述!");
document.form1.conten.select();
document.form1.conten.focus();
return false;
}
if ((document.form1.name.value)=="")
{
window.alert ("请输入联系人!");
document.form1.name.select();
document.form1.name.focus();
return false;
}
if ((document.form1.tel.value)=="")
{
window.alert ("请输入联系电话!");
document.form1.tel.select();
document.form1.tel.focus();
return false;
}
 if  (!(isEmail(document.form1.email.value )))
   {
    alert("输入的邮箱地址错误,请重新输入!");
 document.form1.email.select();
    document.form1.email.focus();
 return false;
    }
else
 {  document.form1.tHtml.value=document.form1.innerHTML;
  document.form1.submit();}

}

                  </script>
    <form id="form1" name="form1" method="post" action="jmail.asp">
     <table width="350" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                <tr>
                  <td colspan="2"><font color="#008F9A"><strong>给我们留言</strong></font></td>
                </tr>
                <tr>
                  <td height="20" align="left"  >发送邮箱:</td>
                  <td><input name="sendemail" type="text" class="input3" id="sendemail" size="20" />
                    *</td>
                </tr>
                <tr>
                  <td width="65" height="20" align="left"  >相关主题:</td>
                  <td><input name="title" type="text" class="input3" id="title" size="20" />
                    *
                    <input name="subject" type="hidden" id="subject" value="客户反馈信息" />
                    <input name="tHtml" type="hidden" id="tHtml" /></td>
                </tr>
                <tr>
                  <td width="65" height="80" align="left"  >相关描述:</td>
                  <td><textarea name="conten" cols="30" rows="5" class="input3" id="conten"></textarea>
                    *</td>
                </tr>
                <tr>
                  <td width="65" height="20" align="left" >公司名称:</td>
                  <td><input name="comname" type="text" class="input3" id="comname" size="20" /></td>
                </tr>
                <tr>
                  <td width="65" height="20" align="left" >联 系 人:</td>
                  <td><input name="name" type="text" class="input3" id="name" size="20" />
                    *</td>
                </tr>
                <tr>
                  <td width="65" height="20" align="left" >联系电话:</td>
                  <td><input name="tel" type="text" class="input3" id="tel" size="20" />
                    *务必真实</td>
                </tr>
                <tr>
                  <td width="65" height="20" align="left" >联系地址:</td>
                  <td><input name="add" type="text" class="input3" id="add" size="20" />                  </td>
                </tr>
                <tr>
                  <td width="65" height="20" align="left" >电子邮件:</td>
                  <td><input name="email" type="text" class="input3" id="email" size="20" />
                    *务必真实</td>
                </tr>
                <tr>
                  <td height="20"> </td>
                  <td>
                    <input name="Submit3" type="button" class="button" value="提交" onclick="return check()"/>
                     
                    <input name="Submit4" type="reset" class="button" value="重置" />                  </td>
                </tr>
                <tr>
                  <td> </td>
                  <td> </td>
                </tr>
            </table>
</form></body>
</html>

jmail.asp页面:
<%
dim sendemail,jmail,tHtml,Subject,content,at63
Subject=trim(request.form("Subject"))
tHtml=trim(request.form("tHtml"))
sendemail=trim(request.form("sendemail"))
   Set JMail = Server.CreateObject("Jmail.Message")
   JMail.From = "daigua2102@
   '来自哪果发送
   JMail.FromName = "客户反馈"
   '发送名
   JMail.CharSet = "GB2312"
   JMail.Priority = 3
   JMail.ReplyTo = "daigua2102@
   '回复email
   JMail.AddRecipient sendemail
   JMail.Subject = Subject
   JMail.AppendText  "客户反馈"
   content = "<link rel=""stylesheet"" type=""text/css"" href=""http://www.
   content=content & thtml
   'thtml变量是整个表单的html代码,表单设置的文本字段<input name="sendemail" type="text" class="input3" id="sendemail" size="20" />,提交时用innerHTML获取表单html代码
   JMail.AppendHTML content
   JMail.MailServerusername = "daigua2102@
   '服务邮箱地址
   JMail.MailServerPassword = "4722188"
   '服务邮箱密码.邮箱密码是正确的.用来演试的.请不要修改我的修改,谢谢合作
   if (JMail.Send ("smtp.)) then
   'JMail.Send 发送服务器
    response.write "<script>alert('发送成功!');history.back(-1);</script>"
   else
    response.write "<script>alert('企业邮箱服务器出现问题.发送失败!');history.back(-1);</script>"
   end if
%>

 

----我怎能在别人的苦难面前转过脸去----
2010-12-07 16:08
快速回复:ASP点击按钮自动发送固定邮件到固定邮箱如何实现
数据加载中...
 
   



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

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