CDOMail发生错误-> AddAttachment(Microsoft VBScript错误"800a0401") [英] CDOMail happned error-> AddAttachment(Microsoft VBScript Error '800a0401')
本文介绍了CDOMail发生错误-> AddAttachment(Microsoft VBScript错误"800a0401")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<%
folder = Request("folder")
if folder="" then folder = "upload"
uploadUrl = "/_data/"&folder&"/"
strFilePath = Server.MapPath("/_data/"&folder)
If Right(strFilePath,1)<>"\" Then strFilePath = strFilePath &"\"
CreateFolder(strFilePath)
Set abc = Server.CreateObject("ABCUpload4.XForm")
abc.AbsolutePath = True
abc.MaxUploadSize = 4*1024*1024 ' 4MB
UpFileSize = abc("uploadFile")(1).length
If UpFileSize>0 then
strImageFileName = abc("uploadFile")(1).FileName
fileExt = lcase(Mid(strImageFileName, InstrRev(strImageFileName, ".") + 1))
If ucase(fileExt)="DOC" or ucase(fileExt)="PDF" or ucase(fileExt)="ZIP" then
strImageFileName = DateFormat("YYYYMMDDHHNNSS",now) &"."& fileExt
abc("uploadFile")(1).Save strFilePath & strImageFileName
If Right(uploadUrl,1)<>"/" Then uploadUrl = uploadUrl &"/"
strUrlPath = uploadUrl & strImageFileName
Else
'
End If
firstname = abc("_1_")
lastname = abc("_2_")
email = abc("_3_")&"@"&abc("_4_")
division = abc("_5_")
title = abc("_6_")
content = abc("_7_")
m_content = FileRead("/contact.html")
m_content = Replace(m_content,"{NAME}", firstname&" "&lastname)
m_content = Replace(m_content,"{email}", email)
m_content = Replace(m_content,"{DATE}", DateFormat("MM/DD/YYYY",date()))
m_content = Replace(m_content,"{Division}", division)
m_content = Replace(m_content,"{title}", title)
m_content = Replace(m_content,"{content}", content)
If Not abc("uploadFile") Is Nothing Then
'-----------------------------------------------------------------------
m_content = AddAttachment strUrlPath <--This Here happened Microsoft VBScript Error '800a0401'
'-----------------------------------------------------------------------
End If
Call CDOMail(contemail, email, "[A company] Thank you for Your email!", m_content)
Call CDOMail(email, contemail, "["&division&"] "&firstname&" "&lastname, m_content)
%>
请告诉我..如何通过cdo邮件发送带有附件的文件?
Please tell me.. how to send with attach files by cdo mail?
推荐答案
好,让我们看看,你说
m_content = AddAttachment strUrlPath
但早些时候你有
strUrlPath = uploadUrl & strImageFileName
看来strUrlPath
指向相对路径.您需要使用Server.MapPath
将其转换为绝对路径.
Well let us look, you said
m_content = AddAttachment strUrlPath
but earlier you had
strUrlPath = uploadUrl & strImageFileName
It looks likestrUrlPath
is pointing to relative path. You need to convert it to absolute path usingServer.MapPath
.
抱歉,sir.i忘记了最高代码.
请再看一遍.
谢谢你,先生.
Sorry,sir.i forgot top codes.
Please, one more see that.
and thank you sir.
这篇关于CDOMail发生错误-> AddAttachment(Microsoft VBScript错误"800a0401")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文