Click here to Skip to main content
16,007,163 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
<%
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&gt;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)&lt;&gt;"/" 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)
%>


Please tell me.. how to send with attach files by cdo mail?
Posted
Updated 27-Jan-11 18:51pm
v4

Well let us look, you said

m_content = AddAttachment strUrlPath

but earlier you had

strUrlPath = uploadUrl & strImageFileName

It looks like strUrlPath is pointing to relative path. You need to convert it to absolute path using Server.MapPath.
 
Share this answer
 
Sorry,sir.i forgot top codes.
Please, one more see that.
and thank you sir.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900