永发信息网

Jmail 代码问题 谢谢帮忙

答案:1  悬赏:20  手机版
解决时间 2021-08-15 19:27
  • 提问者网友:末路
  • 2021-08-14 18:51

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>发送表单</title>
</head>
<body>
<script type="text/javascript" language="JavaScript" src="../../../util.metriserve.com/utild8f0.html?un=PAK752&amp;ws=1"></script>
<div id="lineup" style="position: absolute; visibility: visible; z-index:2"><img src="../images/lineup.gif" height="1" width="100%" border="0" hspace="0" vspace="0"></div>
<div id="menu" style="position: absolute; visibility: ; z-index:3" onMouseOver="clearTimeout(ST);" onMouseOut="ST=setTimeout('killfenetre()',500);"></div>



<%
firstname = Request.Form ("firstname")
lastname = Request.Form ("lastname")
jobtitle = Request.Form ("jobtitle")
company = Request.Form ("company")
address = Request.Form ("address")
town = Request.Form ("town")
zipcode = Request.Form ("zipcode")
country = Request.Form ("country")
phone = Request.Form ("phone")
fax = Request.Form ("fax")
email= Request.Form ("email")
office = Request.Form ("office")

Training_Needs= Request.Form ("Training_Needs")

text1 = Request.Form ("industrysector")
employees = Request.Form ("employees")
typeofcompany = Request.Form ("typeofcompany")
comment = Request.Form ("comment")
trainingme = Request.Form ("trainingme")
trainingcie = Request.Form ("trainingcie")
%>

<%
' 创建jmail对象:
Set JMail = Server.CreateObject("JMail.SMTPMail")

set mail=CreateObject("jmail.Message")
mail.Charset ="gb2312"
mail.From ="xuefaxinxiang@gmail.com"
mail.AddRecipient "xuefaxinxiang@gmail.com"
mail.AddRecipient office
mail.MailDomain="xuefaxinxiang.gmail.com"
mail.MailServerUserName = "xuefaxinxiang@gmail.com"
mail.MailServerPassWord = "*********(此处密码见谅)"
mail.subject="联系我们"

' 下面就是填表在内容区填写的内容,&是连接符,vbcrlf表示换行回车:

mess = mess & "---------------Webmail表单开始-------------------" & vbcrlf
mess = mess & "姓名:" & lastname & firstname & vbcrlf
mess = mess & "法名:" & jobtitle & vbcrlf
mess = mess & "归依年份:" & company & vbcrlf
mess = mess & "地址:" & address & vbcrlf
mess = mess & "城市:" & town & vbcrlf
mess = mess & "国家:" & country & vbcrlf
mess = mess & "电话:" & phone & vbcrlf
mess = mess & "电子邮件:" & email & vbcrlf
mess = mess & "---------------Webmail表单结束-------------------"
mail.Body = mess
On Error Resume Next
mail.Send("smtp.gmail.com")
mail.close()
set mail=nothing

response.write "感谢您填写相关信息,我们会尽快与您联系 ! "
%>



</body>
</html>
我总是收不到邮件 已经调试好几次了 高手们帮忙看看 那里代码写错了 汗

最佳答案
  • 五星知识达人网友:毛毛
  • 2021-08-14 19:09

'***********************************************


Set jmail = Server.CreateObject("JMAIL.Message") '建立发送邮件的对象
jmail.silent = true '屏蔽例外错误,返回FALSE跟TRUE两值j
Jmail.logging = true '启用邮件日志
jmail.Charset = "GB2312" '邮件的文字编码为国标
jmail.ContentType = "text/html" '邮件的格式为HTML格式
jmail.AddRecipient 503131766@qq.com'邮件收件人的地址
jmail.From = "sjf@c-micro.com" '发件人的E-MAIL地址
jmail.MailServerUserName = "sjf@c-micro.com" '登录邮件服务器所需的用户名
jmail.MailServerPassword = "**********" '登录邮件服务器所需的密码
jmail.Subject = "中国聪明网!" '邮件的标题
jmail.Send("mail.c-micro.com") '执行邮件发送(通过邮件服务器地址)
jmail.Close() '关闭对象


'***********************************************

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯