日期:2014-05-17  浏览次数:20953 次

关于在asp中用jmail组件发送邮件的问题
<%
          Set   jmail   =   Server.CreateObject( "JMAIL.Message ")       '建立发送邮件的对象
          jmail.silent   =   true         '屏蔽例外错误,返回FALSE跟TRUE两值
          jmail.logging   =   true       '启用邮件日志
          jmail.Charset   =   "GB2312 "           '邮件的文字编码为国标
          jmail.AddRecipient   "kuangsong333@126.com "           '邮件收件人的地址
          jmail.From   =   "kuangsong333@126.com "       '发件人的E-MAIL地址,注意:部分服务器需要把邮件地址写全,如abc@zccn.net
          jmail.Subject   =   "test "         '邮件的标题  
          jmail.Body   =   "Mail   Body "             '邮件的内容
          jmail.Send( "www.126.com ")           '执行邮件发送(通过邮件服务器地址)smtp.域名.com   不一定是邮件服务器
          jmail.Close()       '关闭对象
          set   jmail   =   nothing
  Response.Write( "success ")
%>
以上是搞到的一段代码.运行不报错.但就是发不进邮箱去.请高手们看看指点一下

------解决方案--------------------
你的iis支持 smtp吗 还有你可以 换一个接收邮箱 试一下
------解决方案--------------------
机器已经安装jmail组件,运行输入net start SMTPSVC.查看SMTPSVC已经启动。再测试,如果提示成功就查看邮件。
------解决方案--------------------
试试这个,我用得很好.
<%
company_name = replace(request.Form( "company_name "), ", ", ", ")
lxr = replace(request.Form( "lxr "), ", ", ", ")
tel1 = replace(request.Form( "tel1 "), ", ", ", ")
tel2 = replace(request.Form( "tel2 "), ", ", ", ")
email = request.Form( "email ")
password = request.Form( "password ")
center = replace(request.Form( "center "), ", ", ", ")
date_time = now()

if company_name = " " then
response.Write( "公司名称不能为空! ")
response.end
end if

if lxr = " " then
response.Write( "联系人不能为空! ")
response.end
end if

if tel1 = " " then
response.Write( "联系电话不能为空! ")
response.end
end if
if email = " " then
response.Write( "您的E_mail不能为空! ")
response.end
end if
if center = " " then
response.Write( "留言内容不能为空! ")
response.end
end if
'sql = "insert into message (company_name,lxr,tel1,tel2,email,center,date_time) values ( ' "&company_name& " ', ' "&lxr& " ', ' "&tel1& " ', ' "&tel2& " ', ' "&email& " ', ' "&center& " ', ' "&date_time& " ') "
'objConn.execute(sql)

'response.Write( "感谢您的留言,我们会尽快与您联系! ")
'response.end

smtpserver= "mail.nivs.cn " '发送邮件所使用的SMTP服务器,例如s