R
Ryan McLean
Hello everyone! I have a question for ya'll. In a web-based asp
application I am creating and (attempting to) attach a file. The
email sends correctly, but when I try to open the attachment, it is
blank. Now, I know you all are probably thinking that the file is
blank on the server or it doesn't exist at the address that I specify.
Well, I checked on the server and the file is there and there is
stuff in it. Could this be a permissions thing, or am I just writing
the syntax incorrectly?
Thanks in advance for any assistance.
Ryan
p.s. Here is some code (notice the response.writes at the bottom of
each sub, they print the same stuff):
call subFileCreate("/gearupqa/reporttemp/",
"Academic_Information.html", strBody)
call subEmail(request.form("txtEmail"), "(e-mail address removed)", "Here is the
report that you requested.", "/gearupqa/reporttemp/",
"Academic_Information.html", "GEAR UP Administration : Academic
Information Page")
sub subEmail(dest, orig, mail_body, path, file_name, subj)
Set objMail = CreateObject("CDONTS.Newmail")
objMail.From = orig & "<GearUp>"
objMail.To = dest & "<" & dest & ">"
objMail.Subject = subj
objMail.AttachFile server.mappath(path & file_name),
file_name objMail.Body = mail_body
objMail.BodyFormat=0 '0 HTML, 1 plain text
objMail.MailFormat=0 '0 MIME format, 1 plain text
objMail.Send()
Set objMail = nothing
response.write(server.mappath(path & file_name) & "<br>")
end sub
sub subFileCreate(path, file_name, text)
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
Set InStream = FileObject.OpenTextFile(server.mappath(path &
file_name), 8, TRUE, -2)
InStream.WriteLine(text)
set InStream = nothing
set FileObject = nothing
response.write(server.mappath(path & file_name) & "<br>")
end sub
Here are the printed paths:
C:\webs\gearup\gearupqa\reporttemp\Academic_Information.html
C:\webs\gearup\gearupqa\reporttemp\Academic_Information.html
Thanks again!
application I am creating and (attempting to) attach a file. The
email sends correctly, but when I try to open the attachment, it is
blank. Now, I know you all are probably thinking that the file is
blank on the server or it doesn't exist at the address that I specify.
Well, I checked on the server and the file is there and there is
stuff in it. Could this be a permissions thing, or am I just writing
the syntax incorrectly?
Thanks in advance for any assistance.
Ryan
p.s. Here is some code (notice the response.writes at the bottom of
each sub, they print the same stuff):
call subFileCreate("/gearupqa/reporttemp/",
"Academic_Information.html", strBody)
call subEmail(request.form("txtEmail"), "(e-mail address removed)", "Here is the
report that you requested.", "/gearupqa/reporttemp/",
"Academic_Information.html", "GEAR UP Administration : Academic
Information Page")
sub subEmail(dest, orig, mail_body, path, file_name, subj)
Set objMail = CreateObject("CDONTS.Newmail")
objMail.From = orig & "<GearUp>"
objMail.To = dest & "<" & dest & ">"
objMail.Subject = subj
objMail.AttachFile server.mappath(path & file_name),
file_name objMail.Body = mail_body
objMail.BodyFormat=0 '0 HTML, 1 plain text
objMail.MailFormat=0 '0 MIME format, 1 plain text
objMail.Send()
Set objMail = nothing
response.write(server.mappath(path & file_name) & "<br>")
end sub
sub subFileCreate(path, file_name, text)
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
Set InStream = FileObject.OpenTextFile(server.mappath(path &
file_name), 8, TRUE, -2)
InStream.WriteLine(text)
set InStream = nothing
set FileObject = nothing
response.write(server.mappath(path & file_name) & "<br>")
end sub
Here are the printed paths:
C:\webs\gearup\gearupqa\reporttemp\Academic_Information.html
C:\webs\gearup\gearupqa\reporttemp\Academic_Information.html
Thanks again!