第一次用jmail 出错,求救

baikaishui_0825 2005-02-22 02:43:26
过程如下:
运行:regsvr32 jmail.dll
执行
<%
function SendMail(SMTPServer,sender,mailto,subject,msg)'这个是一个函数,在程序中可以直接调用。
dim JMail
'on error resume next
'等待功能扩充
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.LazySend = true '这个属性是将邮件放入缓冲直至发出为止,的不到任何的错误信息
JMail.Charset = "euc-kr" '设定邮件的字符集,默认为"US-ASCII" 一般中文用"gb2312"
JMail.ContentType = "text/html" '这个邮件的头设置, 默认为 "text/plain" 能设置成你需要的任何情况。 '你想发送HTML信息,改这个头文件为 "text/html"
JMail.ServerAddress =SMTPServer 'SERVER的地址。可以有很多的SERVER地址,后可跟端口号
JMail.Sender = sender'邮寄的地址
JMail.Subject = subject'邮件的标题。

JMail.AddRecipient mailto'加入一个收件者

JMail.Body = msg 'UBBCode(htmlencode(MSG))E-Mail的主体

JMail.Priority = 1'邮件的优先级,可以范围从1到5。越大的优先级约高,比如,5最高,1最低,一般设置为3


JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")'addheader加入一个头信息
'remote_addr发出请求的机器的IP地址
JMail.Execute'执行邮件发送到SERVER
set jMail=nothing
if err then '检测
SendMail=err.description
err.clear
else
SendMail="OK"
end if
end function
%>
<%
'调用说明:
strHTML = "<table width=""80%"" border=""1"">" &chr(13) &chr(10) '这里需要加上两个"
strHTML = strHTML & " <tr>" &chr(13) &chr(10) 'chr(13)硬回车chr(10)软回车
strHTML = strHTML & "<td align=""center"" valign=""middle"">HELLO~!</td>" &chr(13) &chr(10)
strHTML = strHTML & "</tr>" &chr(13) &chr(10)
strHTML = strHTML & "</table>"
email="baikaishui20000@163.com"
SMTPServer="192.168.18.104:25"
sender="baikaishui20000@163.com"
subject="HEY!"
msg="<HTML><BODY><CENTER>" & strHTML & "</CENTER></BODY></HTML>"
mailto=email'收信人email

call SendMail(SMTPServer,sender,mailto,subject,msg)'调用函数
%>
错误如下:
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

jmail.SMTPMail 错误 '8000ffff'

Win32 Error. Code: 87. 参数错误。

/jmail.asp,行23

...全文
334 27 打赏 收藏 转发到动态 举报
写回复
用AI写文章
27 条回复
切换为时间正序
请发表友善的回复…
发表回复
baikaishui_0825 2005-03-01
  • 打赏
  • 举报
回复
up
butcher2002 2005-02-28
  • 打赏
  • 举报
回复
要指定smtp服务器。。

SMTPServer="192.168.18.104:25"

你指定的这个smtp服务器是否存在?是否服务器已经启动?
baikaishui_0825 2005-02-28
  • 打赏
  • 举报
回复
up
baikaishui_0825 2005-02-28
  • 打赏
  • 举报
回复
常见的其他组件 组 件 名 称 支持及版本
SoftArtisans.FileUp (SA-FileUp 文件上传) ×
SoftArtisans.FileManager (SA-FM 文件管理) ×
JMail.SMTPMail (JMail 邮件发送) √ 4.4
CDONTS.NewMail (CDONTS 邮件发送 SMTP Service) √ 1.2
Persits.MailSender (ASPEmail 邮件发送) ×
LyfUpload.UploadFile (LyfUpload 文件上传) ×
Persits.Upload (ASPUpload 文件上传) ×

baikaishui_0825 2005-02-28
  • 打赏
  • 举报
回复
自己再up
mymyal123 2005-02-28
  • 打赏
  • 举报
回复
up
baikaishui_0825 2005-02-28
  • 打赏
  • 举报
回复
The message was undeliverable. All servers failed to receive the message
.execute()
{
Trying server mail:192.168.18.104:25
192.168.18.104:25 failed with the message: "WSAGetLastError() returned 10061, Connection refused"
No socket for server. ConnectToServer()
1 of 1 servers failed
}



baikaishui_0825 2005-02-28
  • 打赏
  • 举报
回复
set msg = Server.CreateOBject( "JMail.Message" )


msg.Logging = true
msg.silent = true

msg.From = "test@mydomain.com"
msg.FromName = "My Realname"
msg.AddRecipient "baikaishui20000@163.com"
msg.Subject = "How you doin?"
msg.Body = "Hello Jim" & vbCrLf & vbCrLf & "How's it going? ..."


if not msg.Send( "192.168.18.104" ) then
Response.write "<pre>" & msg.log & "</pre>"
else
Response.write "Message sent succesfully!"
end if

%>
bananasmiling 2005-02-28
  • 打赏
  • 举报
回复
要指定smtp服务器。。
JMail.Send ("smtp.sina.net")
baikaishui_0825 2005-02-28
  • 打赏
  • 举报
回复
Simple Mail Transport Protocol (SMTP)这个服务已经启动
192.168.18.104:25
是本机的ip和端口
baikaishui_0825 2005-02-24
  • 打赏
  • 举报
回复
up
yjb136 2005-02-23
  • 打赏
  • 举报
回复
学习中
baikaishui_0825 2005-02-23
  • 打赏
  • 举报
回复
up
baikaishui_0825 2005-02-23
  • 打赏
  • 举报
回复
smtp服务器要怎么设置?
baikaishui_0825 2005-02-23
  • 打赏
  • 举报
回复
呵呵,偶是第一次用这个,哈
我在另外一台电脑上运行这jmail没问题
但是就在偶的电脑,同样的东西,就是出错
错误如下:
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

jmail.SMTPMail 错误 '8000ffff'

The message was undeliverable. All servers failed to receive the message

/jmail1.asp,行13
bananasmiling 2005-02-23
  • 打赏
  • 举报
回复
晕..怎么这个你都不会啊...上面是要用到邮件发送服务器的地址..用户名和密码 的..不然对方是收不到你的信的..

知道了吧..

比如:
JMail.MailServerUserName = "liuixao" '输入smtp服务器验证登陆名 (邮局中任何一个用户的Email地址) -----改
JMail.MailServerPassword = "649" '输入smtp服务器验证密码 (用户Email帐号对应的密码) -----改
JMail.Send ("smtp.sina.net") 'smtp服务器地址(mail.您的域名)-----改
mymyal123 2005-02-23
  • 打赏
  • 举报
回复
学习
kellyrong 2005-02-22
  • 打赏
  • 举报
回复
這應該是郵局中某個郵箱的帳戶和密碼
baikaishui_0825 2005-02-22
  • 打赏
  • 举报
回复
再up
baikaishui_0825 2005-02-22
  • 打赏
  • 举报
回复
JMail.MailServerUserName = "liuixao" '输入smtp服务器验证登陆名 (邮局中任何一个用户的Email地址) -----改
JMail.MailServerPassword = "649" '输入smtp服务器验证密码 (用户Email帐号对应的密码) -----改
这些在那里设置的?
加载更多回复(7)

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧