<%
Set JMail=Server.CreateObject("JMail.Message")
JMail.Logging=True
JMail.Charset="gb2312"
Jmail.MailServerUserName="gzoffice"
Jmail.MailServerPassWord="111111"
JMail.ContentType = "text/html"
JMail.From ="lsqteng@163.com"
JMail.FromName="lsq"
JMail.Subject="试试"
JMail.Body="aaaaaaaaaaaaffffffffffffffffaddddddddddeeeeeeeeee"
JMail.AddRecipient "lsqbbs@163.com"
JMail.Priority=3
Jmail.Send "mail.gzmaplesoft.com"
Set JMail=nothing
%>
(用户密码未用真实密码)
为简单起见,没加入JMail.Silent=true和错误收集代码。
但运行时总是在send处出错。请指教!(从速)谢谢各位!
---------------------------------------------------------------
我认为这是因为你的发件服务器要求身份验证造成的。对于你用的邮件服务器
mail.gzmaplesoft.com。
应该是共享的企业邮局,
所以,
Jmail.MailServerUserName="gzoffice"
这一句不对,应该使用
Jmail.MailServerUserName="gzoffice@gzmaplesoft.com"
,同时,建议加上
JMail.Silent = True
---------------------------------------------------------------
jmial4.3版
<%
dim email,title,msg,smtpserver,smtpuser,smtppwd,smtpemail,jmail,isgo
'收件人信息
email="jerbee@163.com" '//收信人地址
title="你好!" '//标题
msg="我的测试邮件!" '//信件内容
'发送邮件参数设置
smtpserver = "smtp.sina.com.cn" '//邮件服务器(我使用的是新浪的)
smtpuser = "lsqteng" '//你的用户名
smtpemail = "lsqteng@sina.com" '//你的邮箱
smtppwd = "password" '//你的密码
'发送邮件
Set jmail= server.CreateObject ("jmail.message")
jmail.Silent = true
jmail.Charset = "gb2312"
jMail.ContentType = "text/html"
jmail.From = "lsqteng@sina.com" '//这里成你的发信人地址
jmail.FromName = "lsqteng" '//发信人姓名
jmail.Subject = title '//标题
jmail.AddRecipient email '//地址
jmail.Body = msg '//内容
jmail.MailServerUserName = smtpuser
jmail.MailServerPassWord = smtppwd
isgo = jmail.Send(smtpserver)
if err then
SendMail= err.description
err.clear
else
SendMail="发送成功"
end if
jmail.Close
set jmail = nothing
Response.Write SendMail
%>
---------------------------------------------------------------
我用这样的发送成功
Set msg = Server.CreateObject("JMail.Message")
msg.silent = true
msg.Logging = true
msg.Charset = "gb2312"
msg.MailServerUserName = "a@a.net" '输入smtp服务器验证登陆名 (邮局中任何一个用户的Email地址)
msg.MailServerPassword = "abc" '输入smtp服务器验证密码 (用户Email帐号对应的密码)
msg.From = "a@a.net" '发件人Email
msg.FromName = "aaa" '发件人姓名
msg.AddRecipient "b@b.net" '收件人Email
msg.Subject = "test" '信件主题
msg.Body = "testbody"
msg.Send ("mail.a.net") 'smtp服务器地址(企业邮局地址)
set msg = nothing
返回目录