我今天下了个邮件群发系统,我也把里面该改的参数都改了,最后它提示了发送成功,但是却没有接收到,请大家帮我看看是怎么回事,多谢了!
<%
Server.ScriptTimeout=10000
'session("ijob_cishu")=""
'session("ijob_i")=""
if session("ijob_cishu")="" then
session("ijob_cishu")=0
end if
if session("ijob_i")="" then
session("ijob_i")=1
end if
function FSOlinedit(filename,lineNum)
if linenum < 1 then exit function
dim fso,f,temparray,tempcnt
set fso = server.CreateObject("scripting.filesystemobject")
if not fso.fileExists(server.mappath(filename)) then exit function
set f = fso.opentextfile(server.mappath(filename),1)
if not f.AtEndofStream then
tempcnt = f.readall
f.close
set f = nothing
temparray = split(tempcnt,chr(13)&chr(10))
if lineNum>ubound(temparray)+1 then
exit function
else
FSOlinedit = temparray(lineNum-1)
end if
end if
end function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''设置邮件参数
filename="dizhi.txt" '邮件地址列表
dim mailname,mailpass,mailform,mailsmtp
mailname="wyg4859@126.com" '有效电子邮件帐号,有的邮件服务器需要的是ekeer2001@sohu.com等这种格式的帐号,出错后请调整这些!
mailpass="123456" '有效电子邮件密码
mailform="wyg4859@126.com" '发信邮件地址,必须和SMTP相对应起来
mailsmtp="smtp.126.com" 'smtp服务器
dim m_strHTML,Jmail,m_fso,m_tf,filepath,jingyanshuoming,photo,bj1,bj2
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''计算文件行数
Set m_fso = Server.CreateObject("SCRIPTING.FILESYSTEMOBJECT")
filepath=server.mappath(filename)
Set m_tf = m_fso.OpenTextFile(filepath, 1)
m_strHTML = m_tf.ReadAll
bac = m_tf.line
Set m_tf = Nothing
Set m_fso = Nothing
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''读取文件并发送邮件
Set m_fso = Server.CreateObject("SCRIPTING.FILESYSTEMOBJECT")
filepath=server.mappath("1.htm")
Set m_tf = m_fso.OpenTextFile(filepath, 1)
m_strHTML = m_tf.ReadAll
Set m_tf = Nothing
Set m_fso = Nothing
cishu=bac/20
'i=session("ijob_i")
i=session("ijob_cishu")*20
Response.Write "执行第<font color=#ff0000>"&session("ijob_cishu")&"</font>次<br>"
Response.Write "邮件总数:"&bac&"<br>"
Response.Write "需要执行:"&cishu&"<br>"
Response.Write ""&d&"<br>"
for i=i to i+19
Set Jmail=server.createobject("Jmail.Message")
abcd=FSOlinedit(filename,i)
Response.Write "<font color=#ff0000>"&i&"</font>+"&abcd&"<br>"
Jmail.Charset = "gb2312"
JMail.ContentType = "text/html"
Jmail.Silent = true
Jmail.Priority = 3
Jmail.MailServerUserName = wyg4859 '有效电子邮件帐号
Jmail.MailServerPassword = 123456 '有效电子邮件密码
Jmail.From = aaa
Jmail.FromName = "aaa"
Jmail.Subject = "IJOB祝您圣诞快乐!" 'email的标题
Jmail.AddRecipient abcd
Jmail.Body = m_strHTML
Jmail.Send("smtp.126.com") 'smtp服务器地址
Set Jmail=nothing
session("ijob_i")=i+1
if session("ijob_i")>=bac then
Response.Write "邮件发送完成!"
session("ijob_cishu")="" '测试用--清空session
session("ijob_i")="" '测试用--清空session
Response.end
end if
next
session("ijob_cishu")=session("ijob_cishu")+1
response.write "<meta http-equiv=""refresh"" content=""5;url=send.asp"">" '设置系统等待的时间
'Response.Write "发送成功!"
%>