'*********************************
'这是发送邮件调用的文件,实现发送邮件到指定邮箱
'*********************************
if session("straccount")="" or session("strpassword")="" then
Response.End
end if
%
A{text-decoration:none}
正在发送..........
SMTP.LicenseKey = "awa/S19I500R1AX30C0R3100"
SMTP.MailServer = session("strserver")
SMTP.Subject = Request.Form("subject")
SMTP.BodyText = Request.Form("bodytext")
SMTP.From = Request.Form("from")
SMTP.FromAddr = Request.Form("fromaddr")
SMTP.AddRecipient Request.Form("from"), Request.Form("receive1") , 1
'如果有附件则添加附件
if Request.Form("att")="" then
Response.Write ""
else
x = SMTP.AddAttachment(Request.Form("att"), 0)
If Not x = 0 Then
Response.Write "插入附件错误: " + cstr(x) + "请与管理员联系。"
End If
end if
x = SMTP.Send
If x = 0 Then
Response.Write "
邮件已成功发出!"
Else
if x=7 or x=5 then
Response.Write "
发邮件发生错误(" + cstr(x)+ ").发件人地址错误"%
else
Response.Write "
发邮件发生错误: " + cstr(x)+ ""%
end if
End If
Set SMTP = Nothing
%
返回